This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Custom post entry meta on archive page

  • Creator
    Topic
  • #22107
    vnp
    Participant

    Hi, I created a custom post type (‘rooms’). When viewing the (‘rooms’) archive page, entry meta (publish date, author, etc.) is shown per item (just like on normal blog/news). However, for this custom post type, I just want a clean listing: just title, featured image and some text.

    What is the best way to filter out this entry meta for just the custom post type?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #22113
    Jason Bobich
    Keymaster

    Hello,

    There’s really a lot of ways you could go about doing this. First, can you tell me what version of Jump Start you’re currently working with? And are you comfortable with basic PHP from your child theme, or are you more looking to just hide/show stuff with CSS, at this point?

    #22116
    vnp
    Participant

    Yes, I see your point. Currently working on JS 1.2.7, experienced PHP- but at this point not too experienced in the custom post types. I was curious if it could be done with a filter.

    #22122
    askwpgirl
    Participant

    Hi VNP,

    You can create a taxonomy.php file based off the archive.php template and customize as desired. Here’s a taxonomy.php template I created that you can use. I removed the meta data. You can modify as desired:

    http://pastie.org/10245686

    Copy this into a file called taxonomy.php in your child theme folder. This will only work with old versions of JS (i.e 1.2.x).

    Let me know if this works okay for you. I used the default list template. If you want it to contain a post grid, I could send you file for that.

    Angela

    • This reply was modified 6 years, 3 months ago by askwpgirl. Reason: Put code in pastie instead
    #22130
    Jason Bobich
    Keymaster

    Maybe a little more simple of a process: Leaving all other files, as-is, just copy content-archive.php to your child theme. Then within where you see this:

    <?php if ( 'page' != get_post_type() ) : ?>
    	<div class="meta-wrapper">
    		<?php themeblvd_blog_meta(); ?>
    	</div><!-- .meta-wrapper (end) -->
    <?php endif; ?>

    That is currently saying if the post type is not ‘page’ display the meta info. You could change it to include your custom post type like this:

    <?php if ( 'page' != get_post_type() && 'rooms' != get_post_type() ) : ?>
    	<div class="meta-wrapper">
    		<?php themeblvd_blog_meta(); ?>
    	</div><!-- .meta-wrapper (end) -->
    <?php endif; ?>

    … Now it says if the post type is not ‘page’ and ‘rooms’, then include the meta info.

    • This reply was modified 6 years, 3 months ago by Jason Bobich.
    #22140
    askwpgirl
    Participant

    That’s better.

    #22147
    vnp
    Participant

    Very clear! Thanks for the support once again, works like a charm. Askwpgirl thanks for taking the time & effort here.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.