• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Selective display of posts in CPT on archive page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Selective display of posts in CPT on archive page

This topic is: resolved

Tagged: archives, custom post types

  • This topic has 3 replies, 2 voices, and was last updated 9 years ago by Dan.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 24, 2014 at 5:35 am #96374
    Dan
    Participant

    Howdy,
    Using a bit of a mashup between Bill Erickson's Portfolio code and Sridhar's take on the same (the exception being I've not used a plugin to create the CPT), I've created a grid layout archive for a custom post type. I now want to hide some of the custom posts from the CPT archive page as their display is not needed.

    Is this possible? I ask as I've not been able to track down, or work out, a solution yet.

    (Presumably I need to remove the post ID's in a similar fashion to removing page titles on some pages - am I on the right track?)

    If anyone can help, it'd be much appreciated.

    http://allaboutlifting.com.au/products/
    March 24, 2014 at 11:41 am #96429
    Brad Dalton
    Participant

    What you can do is remove specific posts from the CPT archive page loop http://wpsites.net/web-design/3-ways-to-remove-posts-from-your-home-page-loop/

    And change the conditional tag from is_home() to is_post_type_archive(your post type)


    Tutorials for StudioPress Themes.

    March 24, 2014 at 4:37 pm #96491
    Dan
    Participant

    That, Brad, is EXACTLY what I wanted to do - thank you so much!

    March 29, 2014 at 9:14 pm #97367
    Dan
    Participant

    Quick update - just realised need to add an

    if(!is_admin()){

    conditional unless you want to hide the items in the dashboard too!

    🙂

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Selective display of posts in CPT on archive page’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble