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 9 years, 7 months ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
September 16, 2014 at 8:51 pm #124723brettatkinMember
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 #124746Brad DaltonParticipant -
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘General Discussion’ is closed to new topics and replies.