Tagged: x
-
AuthorPosts
-
May 31, 2016 at 2:00 pm #1018660
GreaterGoodSolutionsParticipantHello, I have created a blog page template in Cornerstone (http://staging.wanderingearl.com/template-demonstration-post/) but I would prefer it have it hardcoded the PHP for the individual post page rather than having to use the template. The blogger who is using this site is comfortable with the WP text entry area and would prefer to use it rather than the template. Can you let me know how to do this?
Thanks in advance!
May 31, 2016 at 2:46 pm #1018719
Nabeel AModeratorHi there,
Thanks for writing in! Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding. Take care!
June 5, 2016 at 11:47 am #1026762
GreaterGoodSolutionsParticipantThanks for the response. I understand that this is outside the scope of the existing theme and am willing to make the changes myself but I was hoping you could advise me on the proper php edits. Thank you.
June 5, 2016 at 11:03 pm #1027328
RadModeratorHi there,
You mean add static content on the bottom of every user added content? Should it be specific to post or page too?
You can do this, add this code to your child theme’s functions.php with your pre-made content.
add_filter( 'the_content', 'global_content', 99999 ); function global_content ( $content ) { if ( is_singular() ) { ob_start(); ?> <!--- YOUR CONTENT HERE --> <?php $content.= ob_get_clean(); } return $content; }If it’s shortcode templates, then you can do something like this
add_filter( 'the_content', 'global_content', 99999 ); function global_content ( $content ) { if ( is_singular() ) { $content.= do_shortcode('<!----your shortcode content here-->'); } return $content; }And if you wish to target pages too, then change it to :
if ( is_singular() || is_page() )Cheers!
June 6, 2016 at 12:26 pm #1028383
GreaterGoodSolutionsParticipantThank you very much! I’m looking to add the content to the bottom of every blog post but don’t need it to display on any other pages.
June 6, 2016 at 9:03 pm #1029134
RadModeratorHi there,
In that case, don’t add
|| is_page()in your code 🙂Cheers!
June 7, 2016 at 8:49 am #1029901
GreaterGoodSolutionsParticipantOkay, thanks again. You guys rule!
June 7, 2016 at 10:31 am #1030107
ThaiModeratorYou’re most welcome 🙂
If you need anything else please let us know.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1018660 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
