• 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

META Titles for CPT pages

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 › META Titles for CPT pages

This topic is: not resolved
  • This topic has 1 reply, 2 voices, and was last updated 11 years, 2 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 16, 2014 at 8:51 pm #124723
    brettatkin
    Member

    The following page is generated from a CPT. How do I set the META tags? Thanks.

    http://www.fivethirtyhome.com/gallery/

    Here is the function that creates the CPT:

    //* Create slider custom post type 
    add_action( 'init', 'slider_post_type' );
    function slider_post_type() {
        register_post_type( 'slider',
            array(
                'labels' => array(
                    'name' => __( 'Slider' ),
                    'singular_name' => __( 'Slider' ),
                ),
                'exclude_from_search' => true,
                'has_archive' => true,
                'hierarchical' => true,
                'public' => true,
                'rewrite' => array( 'slug' => 'offers', 'with_front' => FALSE ),
                'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'revisions', 'page-attributes', 'genesis-seo' ),
            )
        );
    }

    Here is the code for the archive page:

    <?php
    //* The custom portfolio post type archive template
    
    //* Add the portfolio blurb section
    add_action( 'genesis_before_content', 'swank_galleryblurb_before_content' );
    function swank_galleryblurb_before_content() {
    
    	genesis_widget_area( 'galleryblurb', array(
    	'before' => '<div class="galleryblurb">',
    	) );
    
    	echo '<header class="entry-header"><h1 class="entry-title" itemprop="headline">Gallery</h1></header>';	
    	echo '<p>Our inventory is ever-changing, so be sure and stop in soon to see what\'s new. If you like a particular piece you see on our <a title="Visit Us on Facebook" href="https://www.facebook.com/530resale" target="_blank">Facebook page</a>, call ahead to 317-567-7781 and we\'ll gladly hold it for you (but hurry...items tend to sell quickly).</p>';
    	echo '<p>(Click each image to view all the images in that gallery)</p>';
    
    }
    
    //* Add the featured image after post title
    add_action( 'genesis_entry_header', 'swank_gallery_grid' );
    function swank_gallery_grid() {
    
    	if ( has_post_thumbnail() ){
    		echo '<div class="gallery-featured-image">';
    		echo '<a href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
    		echo get_the_post_thumbnail($thumbnail->ID, 'gallery-featured');
    		echo '</a>';
    		echo '</div>';
    	}
    
    }
    
    //* Remove the ad widget
    remove_action( 'genesis_before_loop', 'adspace_before_loop' );
    
    //* Remove author box
    remove_action( 'genesis_after_entry', 'genesis_do_author_box_single', 8 );
    
    //* Remove the post meta function
    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    
    //* Remove the post info function
    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    
    //* Force full width content layout
    //* add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    
    //* Remove the post content
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    
    //* Remove the footer widgets
    //remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
    
    genesis();
    September 17, 2014 at 5:53 am #124746
    Brad Dalton
    Participant

    Set the META tags?

    Please clarify.


    Tutorials for StudioPress Themes.

  • 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

© 2025 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