• 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

CPT Page Titles on Archive

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 › General Discussion › CPT Page Titles on Archive

This topic is: resolved

Tagged: display-page-title-full-width-featured-image-genesis

  • This topic has 1 reply, 1 voice, and was last updated 8 years, 4 months ago by alistairmckenzie.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 15, 2015 at 6:04 am #137520
    alistairmckenzie
    Member

    HI I have used this tutorial (which is great) http://sridharkatakam.com/display-page-title-full-width-featured-image-genesis/ and it works great on all pages and posts except on my CPT types archive page, it adds the featured images in great but it strips the titles from the cpts and uses the latest posts title instead of the page title,

    You can see more clearly by going to this page http://iwsandbox.co.uk/specialised/loggia/ ( which is correct ) and either of the below for the problem pages.

    http://iwsandbox.co.uk/specialised/projects/ or http://iwsandbox.co.uk/specialised/news/

    any help will be much appreciated regards Alistair

    http://iwsandbox.co.uk/specialised/news/
    January 16, 2015 at 4:41 am #137646
    alistairmckenzie
    Member

    Incase anybody else wants to know fixed it in the CPT as below:

    /** Create portfolio custom post type post_type_name */
    add_action( 'init', 'create_custom_post_type' );
    function create_custom_post_type() {
    register_post_type( 'post_type_name',
    array(
    'labels' => array(
    'name' => __( 'post_type_name', 'Theme_name' ),
    'singular_name' => __( 'post_type_name', 'Theme_name' ),
    ),
    'has_archive' => true,
    'hierarchical' => true,
    'public' => true,
    'rewrite' => array( 'slug' => 'post_type_name' ),
    'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'genesis-seo', 'genesis-cpt-archives-settings' ),
    )
    );
    }

    function add_portfolio_page_title() {
    if ( is_post_type_archive( 'post_type_name' ) )
    echo '<div class="entry-header-wrapper"><h1>Your Page Title Here</h1><div class="wrap">';
    };
    add_action('genesis_after_header', 'add_portfolio_page_title');

    // Add featured image to CPT post_type_name
    function feature_image_header() {
    if( is_singular('post_type_name') && has_post_thumbnail()) {

    genesis_image(
    array(
    'size' => 'single-post',
    'attr' => array( 'class' => 'alignleft' )
    ) );
    }
    }

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘General Discussion’ is closed to new topics and 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