My archive page for my quote generator shows the post meta data for each quote. It clutters my listings.
I’d rather it only show the quote title and the quote. I found this article which shows me how to delete the post meta from a single page for a custom post type which is close but not exactly what I want.
I want the post meta to show for single pages of my quote, but not for the archive. So, I just changed the following line of the code:
// if (is_post_type('quote') && is_single()) { //
to this:
// if (is_post_type('quote') && !is_single()) { //
It worked! Now my quotes archive page looks like this instead:
I still want to get rid of the ‘Filed Under’ section on each listing on the archive page. I added a line to remove the post meta which changed my function to look like this:
// // remove post info and meta from cpt add_action ('get_header', 'custom_remove_post_info'); function custom_remove_post_info() { if (is_post_type('quote') && !is_single()) { remove_action ('genesis_before_post_content', 'genesis_post_info'); remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); } } //
I have this now:
I didn’t want to lose my gray line underneath which separated the individual quotes, so now I need to add that back in. I did that by making an entry in my style.css file for my post type which is ‘quote’.
// .quote { border-bottom: 1px solid #e6e6e6; padding-top: 15px; } //
Perfect! I now how what I wanted, which is this: