Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing Post Info Data – Not Working | Pretty Pictures ChildTheme
Tagged: .post-info, pretty picture
- This topic has 13 replies, 2 voices, and was last updated 10 years, 8 months ago by
SoZo.
-
AuthorPosts
-
January 22, 2013 at 12:13 pm #13749
KBordonaro
MemberHello!
I am having problems getting the Post Info to remove.
I've followed the directions in this tutorial, placing the snippet code in my childtheme's functions php, but the post info remains.
I've tried refreshing and viewing in a different browser (in case its cached) but my site still shows the post info.
What am I doing wrong?
Thanks,
Kimberly
January 22, 2013 at 12:17 pm #13753SoZo
MemberDid the theme come with the post info already edited in functions.php?
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 12:47 pm #13768KBordonaro
MemberHi, John.
I'm not sure...
I'm trying to remove the post info that came with the function. So I'm guessing, yes?
--Kimberly
January 22, 2013 at 12:48 pm #13769SoZo
MemberLook in functions.php for a preexisting function that edits the post info
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 12:51 pm #13771KBordonaro
MemberOkay, cool. This is what I found....
/** Customize the post info function */
add_filter( 'genesis_post_info', 'pp_post_info_filter' );
function pp_post_info_filter( $post_info ) {return __( 'Posted on', 'pictures' ) . ' [post_date] [post_comments] [post_edit]';
Should I remove this all together from the function and enter the other code snippet instead?
January 22, 2013 at 12:53 pm #13774SoZo
MemberYep, just remove that and then the remove action you added should work
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 1:04 pm #13791KBordonaro
MemberI erased that snippet and I put in the other snippet from the tutorial, but the post info is still showing up.
I checked on a different browser for cache problems, too.
January 22, 2013 at 1:05 pm #13792SoZo
MemberPost the contents of functions.php
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 1:18 pm #13796KBordonaro
Member/** Remove the post info function */
remove_action( 'genesis_before_post_content', 'genesis_post_info' );January 22, 2013 at 1:19 pm #13798SoZo
MemberPost the entire content of functions.php
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 1:22 pm #13801KBordonaro
MemberD-oh! Blonde Moment... Here you go:
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );load_child_theme_textdomain( 'pictures', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'pictures' ) );
/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', __( 'Pretty Pictures Theme', 'pictures' ) );
define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/pretty-pictures' );/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'pp_add_viewport_meta_tag' );
function pp_add_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}/** Register default layout setting */
genesis_set_default_layout( 'full-width-content' );/** Unregister layouts */
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );/** Unregister sidebars */
unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );/** Add support for custom header */
add_theme_support( 'custom-header', array(
'default-image' => get_stylesheet_directory_uri() . '/images/header.jpg',
'flex-height' => true,
'flex-width' => true,
'header-text' => false,
'height' => 550,
'width' => 1600
) );/** Reposition the primary navigation */
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );/** Unregister secondary navigation menu */
add_theme_support( 'genesis-menus', array( 'primary' => __( 'Primary Navigation Menu', 'pictures' ) ) );/** Add support for post formats */
add_theme_support( 'post-formats', array(
'gallery',
'quote'
) );/** Remove elements for post formats */
add_action( 'genesis_before_post', 'pp_remove_elements' );
function pp_remove_elements() {// Remove if post has quote format
if ( has_post_format( 'quote' ) ) {
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
}// Remove if post has gallery format
elseif ( has_post_format( 'gallery' ) ) {
add_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
}// Add back, as post has no format
else {
add_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
}}
global $current_class;
$current_class = 'odd';/** Add odd/even post class */
add_filter ( 'post_class' , 'pp_alt_post_class' );
function pp_alt_post_class ( $classes ) {
global $current_class;
$classes[] = $current_class;
$current_class = ( $current_class == 'odd' ) ? 'even' : 'odd';
return $classes;
}/** Customize the post meta function */
add_filter( 'genesis_post_meta', 'pp_post_meta_filter' );
function pp_post_meta_filter($post_meta) {return __( '© Copyright', 'pictures' ) . ' [post_author_posts_link]';
}
/** Modify the size of the Gravatar in the author box */
add_filter( 'genesis_author_box_gravatar_size', 'pp_author_box_gravatar_size' );
function pp_author_box_gravatar_size( $size ) {
return '76';
}/** Load Backstretch script and prepare images for loading */
add_action( 'wp_enqueue_scripts', 'pp_enqueue_scripts' );
function pp_enqueue_scripts() {wp_enqueue_script( 'stretch-backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0', true );
wp_enqueue_script( 'stretch-backstretch-set', get_bloginfo('stylesheet_directory').'/js/backstretch-set.js' , array( 'jquery', 'stretch-backstretch' ), '1.0.0', true );}
add_action( 'wp_enqueue_scripts', 'pp_set_background_image' );
function pp_set_background_image() {$image = array( 'src' => get_header_image() );
wp_localize_script( 'stretch-backstretch-set', 'BackStretchImg', $image );
}
/** Register newsletter widget area */
genesis_register_sidebar( array(
'id' => 'newsletter',
'name' => __( 'Newsletter', 'custom-theme' ),
'description' => __( 'This is the newsletter section.', 'custom-theme' ),
) );/** Add the newsletter widget after the post content */
add_action( 'genesis_after_post_content', 'custom_add_newsletter_box' );
function custom_add_newsletter_box() {
if ( is_singular( 'post' ) )
genesis_widget_area( 'newsletter', array(
'before' => '<div id="enews widget-area">',
) );
}/** Add support for 2-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 2 );/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );
/** Remove the post info function */
remove_action( 'genesis_before_post_content', 'genesis_post_info' );January 22, 2013 at 1:33 pm #13806SoZo
MemberOk, try removing
add_action( 'genesis_before_post_content', 'genesis_post_info' );from
// Add back, as post has no format
else {
add_action( 'genesis_before_post_content', 'genesis_post_info' );
add_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_after_post_content', 'genesis_post_meta' );
}
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 22, 2013 at 1:41 pm #13810KBordonaro
MemberSoZo, you rock my world.
Thank you!
January 22, 2013 at 2:24 pm #13818SoZo
Member -
AuthorPosts
- The topic ‘Removing Post Info Data – Not Working | Pretty Pictures ChildTheme’ is closed to new replies.