Remove Metadata from Top of Posts
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
I’m using CBOX and the CBOX Theme. Is it possible to remove the metadata from above posts?
<span class=”post-author”>This is what I’m talking about just under the title: </span>
<span class=”post-author”>greg </span><span class=”post-category”> Video </span><span class=”time-posted”> <time class=”entry-date” datetime=”2015-11-18T18:15:21+00:00″>November 18, 2015</time></span><span class=”post-comments”> No Comments » I’ve attached an image.</span>
I would like to know how to remove all that from both individual posts and all posts.
Thanks, Greg
You’ll need to create a child theme and override the loop-single.php template.
See the CBOX Theme Developer Guide and in particular Overwriting theme templates and using hooks.
Cheers, Christian
Thanks Christian…I did create a child theme…but nothing I’ve tried has had any effect. So this all is going WHOOSH…right over my head. 🙂
Hi Greg, in order to change or remove the markup of the post metadata, you need to override the ‘loop-single.php’ template by copying the one in the CBOX theme to the same relative position in your child theme (I’m going to call its enclosing folder ‘cbox-child’ below).
In this instance it means copying ‘cbox-theme/templates/loops/loop-single.php’ to ‘cbox-child/templates/loops/loop-single.php’ where you can remove the metadata completely by commenting out the line that reads:
infinity_get_template_part( 'templates/parts/post-meta-top');
For you, it should then read:
//infinity_get_template_part( 'templates/parts/post-meta-top');
If you want finer control of what’s in the metadata section itself, copy ‘cbox-theme/templates/parts/post-meta-top.php’ to ‘cbox-child/templates/parts/post-meta-top.php’ and edit its content to your requirements. As long as your child theme is the active theme, this will take precedence over the one in ‘cbox-theme’.
Cheers, Christian