Add a custom post type in a menu

Community Forums Forums General Discussion Add a custom post type in a menu

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  chikamiku 11 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #66388

    chikamiku
    Participant
    Post count: 66

    Just two questions please.

    How can I add a custom post type in a menu? Please explain the concept in a non-technical way.

    What URL should I use to link a custom post type to a banner image?

    Thanks and regards

    #66493

    braddalton
    Participant
    Post count: 9759

    You mean you want to add a link to a single custom post type or archive custom post type?

    How did you create the custom post type? Can you link to it please.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #66496

    chikamiku
    Participant
    Post count: 66

    I created these custom post types by using a plugin called Custom Post Types UI. Creating a post type is perhaps not an issue. I am unable to to go to the next steps of actually displaying the post types properly in the top nav, and, in banners linking to images. on the homepage of the site or anywhere else.

    I perhaps know the answer would be in creating custom templates for the purpose. But which code to use. Any code examples would be great if possible.

    In the top nav, I want to link a post type showing all the posts in that post type. However, once I click on a certain post title, it should take me to that single post . This is some thing which regular posts already implement. But I do not know how to do it for custom post types.

    Thanks again for the quick response.

    Thanks and regards

    #66497

    chikamiku
    Participant
    Post count: 66

    Is there any step-by-step tutorial explaining all these things in a genesis way? I got some clue for non-genesis themes. but I wanted to get info with reference to Genesis framework only.

    Thanks and regards

    #66498

    braddalton
    Participant
    Post count: 9759

    You want an archive page template for your custom post types? http://www.carriedils.com/custom-post-type-archive-template/

    Or you could simple copy and paste all this code.http://wpsites.net/web-design/add-responsive-portfolio-page-to-lifestyle-pro/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #66544

    chikamiku
    Participant
    Post count: 66

    Hello Brad,

    Thank you again for the message. I got the following results after implementing both the links you sent me.

    http://www.halalfriendlyhotel.com/masajid/

    The Masajid post type is showing up. However, I click on single post types as you can see the above.

    I used the second link you sent me to create the files the tutorial you asked me to follow and got the following result for hotels post type. http://www.halalfriendlyhotel.com/hotels-2/

    Could you please guide me where am I making mistakes?

    Thanks and I hope to hear form you soon.

    Thanks

    #66576

    braddalton
    Participant
    Post count: 9759

    Make sure you upload images which are exactly the same size as what the code uses and re-save your permalinks which will flush the re-write rules in your .htaccess.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #68283

    chikamiku
    Participant
    Post count: 66

    Brad,

    Thank you again. However, I am still struggling with this all. I thought I should try to create CPTs by adding few code lines instead of using a plugin. So I used the following code. I created a file called archive-trade-shows.php with the following code inside it. But with no luck.. Any clues on how to do that please.

    Thanks again.

    //* Add a custom post type
    add_action( ‘init’, ‘cd_post_type’ );
    function cd_post_type() {
    // Trade Shows custom post type
    register_post_type( ‘tradeshow’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Trade Shows’ ),
    ‘singular_name’ => __( ‘Trade Show’ ),
    ),
    ‘has_archive’ => true,
    ‘public’ => true,
    ‘show_ui’ => true, // defaults to true so don’t have to include
    ‘show_in_menu’ => true, // defaults to true so don’t have to include
    ‘rewrite’ => array( ‘slug’ => ‘portfolio’ ),
    ‘supports’ => array( ‘title’, ‘editor’, ‘genesis-seo’, ‘thumbnail’,’genesis-cpt-archives-settings’ ),
    )
    );
    }

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.