Removing Post Info Data – Not Working | Pretty Pictures ChildTheme

Community Forums Forums Design Tips and Tricks Removing Post Info Data – Not Working | Pretty Pictures ChildTheme

This topic is: not resolved

This topic contains 13 replies, has 2 voices, and was last updated by  SoZo 1 year, 11 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #13749

    KBordonaro
    Participant
    Post count: 22

    Hello!

    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

    http://www.kimberlybordonaro.com

    #13753

    SoZo
    Moderator
    Post count: 1573

    Did the theme come with the post info already edited in functions.php?


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13768

    KBordonaro
    Participant
    Post count: 22

    Hi, John.

    I’m not sure…

    I’m trying to remove the post info that came with the function. So I’m guessing, yes?

    –Kimberly

    #13769

    SoZo
    Moderator
    Post count: 1573

    Look in functions.php for a preexisting function that edits the post info


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13771

    KBordonaro
    Participant
    Post count: 22

    Okay, 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?

    #13774

    SoZo
    Moderator
    Post count: 1573

    Yep, just remove that and then the remove action you added should work


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13791

    KBordonaro
    Participant
    Post count: 22

    I 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.

    #13792

    SoZo
    Moderator
    Post count: 1573

    Post the contents of functions.php


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13796

    KBordonaro
    Participant
    Post count: 22

    /** Remove the post info function */
    remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );

    #13798

    SoZo
    Moderator
    Post count: 1573

    Post the entire content of functions.php


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #13801

    KBordonaro
    Participant
    Post count: 22

    D-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 __( ‘&copy; 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’ );

    #13806

    SoZo
    Moderator
    Post count: 1573

    Ok, 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

    #13810

    KBordonaro
    Participant
    Post count: 22

    SoZo, you rock my world.

    Thank you!

    #13818

    SoZo
    Moderator
    Post count: 1573

    You’re welcome :)


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

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

The topic ‘Removing Post Info Data – Not Working | Pretty Pictures ChildTheme’ is closed to new replies.