Change "Filed Under" in Sixteen Nine Theme

Community Forums Forums Design Tips and Tricks Change "Filed Under" in Sixteen Nine Theme

This topic is: not resolved

This topic contains 18 replies, has 2 voices, and was last updated by  vangelisbel 12 months ago.

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #75188

    vangelisbel
    Member
    Post count: 21

    Hi!

    I”m trying to change the Post meta title from “Filed Under” to “Categories” in Sixteen NIne Pro theme. I pasted the following code in functions.php, but the title “Filed Under” doesn’t change.
    Am I doing something wrong?

    //* Customize the post meta function
    add_filter( ‘genesis_post_meta’, ‘sp_post_meta_filter’ );
    function sp_post_meta_filter($post_meta) {
    if ( !is_page() ) {
    $post_meta = ‘[post_categories before="Categories: "]‘;
    return $post_meta;
    }}

    http://www.mykonosphotographer.com/?page_id=48
    #75190

    nutsandbolts
    Keymaster
    Post count: 3187

    Change this:

    [post_categories before="Filed Under: "]

    to this:

    [post_categories before="Categories: "]

    and that should get it working. :)


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75191

    vangelisbel
    Member
    Post count: 21

    Im sorry I wrote the wrong code before. I edited my first message.

    The code i used is:

    //* Customize the post meta function
    add_filter( ‘genesis_post_meta’, ‘sp_post_meta_filter’ );
    function sp_post_meta_filter($post_meta) {
    if ( !is_page() ) {
    $post_meta = ‘[post_categories before="Categories: "]‘;
    return $post_meta;
    }}

    but as I told you before, it doesn’t work. Any ideas?

    • This reply was modified 12 months ago by  vangelisbel.
    • This reply was modified 12 months ago by  vangelisbel.
    #75198

    nutsandbolts
    Keymaster
    Post count: 3187

    I just tried it on a test site and it worked fine for me…. Hmmm…..

    Where did you place it in functions.php? If you put it at the end, try putting it up higher – between any two existing functions should be fine.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75201

    vangelisbel
    Member
    Post count: 21

    Hi again and thanks so much for trying to help!

    I copied and pasted my whole fuctions.php file below and I made the post meta code bold.

    Did you test the code in the same theme?
    Could this be a Genesis 2 or HTML5 thing that requires a different code?

    <?php
    //* Start the engine
    include_once( get_template_directory() . ‘/lib/init.php’ );

    //* Set Localization (do not remove)
    load_child_theme_textdomain( ‘sixteen-nine’, apply_filters( ‘child_theme_textdomain’, get_stylesheet_directory() . ‘/languages’, ‘sixteen-nine’ ) );

    //* Child theme (do not remove)
    define( ‘CHILD_THEME_NAME’, __( ‘Vangelisphotography Theme’, ‘vangelisphotography’ ) );
    define( ‘CHILD_THEME_URL’, ‘http://www.vangelisphotography.com’ );
    define( ‘CHILD_THEME_VERSION’, ’1.0′ );

    //* Add HTML5 markup structure
    add_theme_support( ‘html5′ );

    //* Add viewport meta tag for mobile browsers
    add_theme_support( ‘genesis-responsive-viewport’ );

    //* Enqueue Playfair Display and Roboto family of Google fonts
    add_action( ‘wp_enqueue_scripts’, ‘sixteen_nine_google_fonts’ );
    function sixteen_nine_google_fonts() {

    wp_enqueue_style( ‘google-font’, ‘//fonts.googleapis.com/css?family=Playfair+Display:300italic|Roboto:300,700|Roboto+Condensed:300,700|Roboto+Slab:300′, array(), PARENT_THEME_VERSION );

    }

    //* Enqueue Backstretch script and prepare images for loading
    add_action( ‘wp_enqueue_scripts’, ‘sixteen_nine_enqueue_scripts’ );
    function sixteen_nine_enqueue_scripts() {

    wp_enqueue_script( ‘sixteen-nine-responsive-menu’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/responsive-menu.js’, array( ‘jquery’ ), ’1.0.0′ );

    //* Load scripts only if custom background is being used
    if ( ! get_background_image() )
    return;

    wp_enqueue_script( ‘sixteen-nine-backstretch’, get_bloginfo( ‘stylesheet_directory’ ) . ‘/js/backstretch.js’, array( ‘jquery’ ), ’1.0.0′ );
    wp_enqueue_script( ‘sixteen-nine-backstretch-set’, get_bloginfo(‘stylesheet_directory’).’/js/backstretch-set.js’ , array( ‘jquery’, ‘sixteen-nine-backstretch’ ), ’1.0.0′ );
    wp_localize_script( ‘sixteen-nine-backstretch-set’, ‘BackStretchImg’, array( ‘src’ => get_background_image() ) );

    }

    //* Customize the post meta function
    add_filter( ‘genesis_post_meta’, ‘sp_post_meta_filter’ );
    function sp_post_meta_filter($post_meta) {
    if ( !is_page() ) {
    $post_meta = ‘[post_categories before="Categories: "]‘;
    return $post_meta;
    }}

    //* Add support for custom background
    add_theme_support( ‘custom-background’, array( ‘wp-head-callback’ => ‘__return_false’ ) );

    //* Add support for custom header
    add_theme_support( ‘custom-header’, array(
    ‘admin-preview-callback’ => ‘sixteen_nine_admin_header_callback’,
    ‘default-text-color’ => ‘ffffff’,
    ‘header-selector’ => ‘.site-header .site-avatar img’,
    ‘height’ => 121,
    ‘width’ => 224,
    ‘wp-head-callback’ => ‘sixteen_nine_header_callback’,
    ) );

    function sixteen_nine_admin_header_callback() {
    echo get_header_image() ? ‘‘ : get_avatar( get_option( ‘admin_email’ ), 224 );
    }

    function sixteen_nine_header_callback() {

    if ( ! get_header_textcolor() )
    return;

    printf( ‘<style type=”text/css”>.site-title a { color: #%s; }</style>’ . “\n”, get_header_textcolor() );
    }

    //* Unregister layout settings
    genesis_unregister_layout( ‘sidebar-content’ );
    genesis_unregister_layout( ‘content-sidebar-sidebar’ );
    genesis_unregister_layout( ‘sidebar-sidebar-content’ );
    genesis_unregister_layout( ‘sidebar-content-sidebar’ );

    //* Unregister primary/secondary navigation menus
    remove_theme_support( ‘genesis-menus’ );

    //* Unregister secondary sidebar
    unregister_sidebar( ‘sidebar-alt’ );

    //* Hook site avatar before site title
    add_action( ‘genesis_header’, ‘sixteen_nine_site_gravatar’, 5 );
    function sixteen_nine_site_gravatar() {

    $header_image = get_header_image() ? ‘‘ : get_avatar( get_option( ‘admin_email’ ), 224 );

    printf( ‘<div class=”site-avatar”>%s</div>’, home_url( ‘/’ ), $header_image );

    }

    //* Hook after post widget after the entry content
    add_action( ‘genesis_after_entry’, ‘sixteen_nine_after_entry’, 5 );
    function sixteen_nine_after_entry() {

    if ( is_singular( ‘post’ ) )
    genesis_widget_area( ‘after-entry’, array(
    ‘before’ => ‘<div class=”after-entry” class=”widget-area”>’,
    ‘after’ => ‘</div>’,
    ) );

    }

    //* Modify the size of the Gravatar in the author box
    add_filter( ‘genesis_author_box_gravatar_size’, ‘sixteen_nine_author_box_gravatar’ );
    function sixteen_nine_author_box_gravatar( $size ) {

    return 140;

    }

    //* Modify the size of the Gravatar in the entry comments
    add_filter( ‘genesis_comment_list_args’, ‘sixteen_nine_comments_gravatar’ );
    function sixteen_nine_comments_gravatar( $args ) {

    $args['avatar_size'] = 96;

    return $args;

    }

    //* Reposition the footer
    remove_action( ‘genesis_footer’, ‘genesis_footer_markup_open’, 5 );
    remove_action( ‘genesis_footer’, ‘genesis_do_footer’ );
    remove_action( ‘genesis_footer’, ‘genesis_footer_markup_close’, 15 );
    add_action( ‘genesis_header’, ‘genesis_footer_markup_open’, 11 );
    add_action( ‘genesis_header’, ‘genesis_do_footer’, 12 );
    add_action( ‘genesis_header’, ‘genesis_footer_markup_close’, 13 );

    //* Customize the footer
    add_filter( ‘genesis_footer_output’, ‘sixteen_nine_custom_footer’ );
    function sixteen_nine_custom_footer( $output ) {

    $output = sprintf( ‘<p>%s%s</p>’, __( ‘Powered by ‘, ‘sixteen-nine’ ), __( ‘Genesis’, ‘sixteen-nine’ ) );
    return $output;

    }

    // Add Read More Link to Excerpts
    add_filter(‘excerpt_more’, ‘get_read_more_link’);
    add_filter( ‘the_content_more_link’, ‘get_read_more_link’ );
    function get_read_more_link() {
    return ‘… [View full post]‘;
    }

    //***Customize The Comment Form**/
    add_filter( ‘comment_form_defaults’, ‘bourncreative_custom_comment_form’ );
    function bourncreative_custom_comment_form($fields) {
    $fields['comment_notes_before'] = ”; //Removes Email Privacy Notice
    $fields['title_reply'] = __( ‘Share your Comments:’, ‘customtheme’ ); //Changes The Form Headline
    $fields['label_submit'] = __( ‘Share my Comment’, ‘customtheme’ ); //Changes The Submit Button Text
    $fields['comment_notes_after'] = ”; //Removes Form Allowed Tags Box
    return $fields;
    }

    //* Remove the site title
    remove_action( ‘genesis_site_title’, ‘genesis_seo_site_title’ );

    //* Remove the site description
    remove_action( ‘genesis_site_description’, ‘genesis_seo_site_description’ );

    //* Register widget areas
    genesis_register_sidebar( array(
    ‘id’ => ‘after-entry’,
    ‘name’ => __( ‘After Entry’, ‘sixteen-nine’ ),
    ‘description’ => __( ‘This is the widget that appears after the entry on single posts.’, ‘sixteen-nine’ ),
    ) );

    #75206

    nutsandbolts
    Keymaster
    Post count: 3187

    Yep, I tested on Sixteen Nine. I don’t see anything at all that should be affecting that snippet… So weird. You aren’t using a caching plugin by any chance, are you?


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75207

    nutsandbolts
    Keymaster
    Post count: 3187

    You know, I just noticed you’re using the default permalinks, so I wonder if the conditional is why it’s not working. Try changing your permalinks to postname under Settings > Permalinks (you can always change them back afterward if you prefer the default) to see if that gets it to change.

    As it is, the function is set not to work on pages, so that will count out the page you linked to in your original post. So the conditional itself may be the problem, though it wouldn’t hurt to rule out permalinks.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75210

    vangelisbel
    Member
    Post count: 21

    I have no caching plugins.
    I changed the permalinks, but still no change..
    I can’t really understand why though…

    #75212

    nutsandbolts
    Keymaster
    Post count: 3187

    Okay, try it with no conditional (be sure you either copy and paste or take out the second bracket at the end as well):

    add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
    function sp_post_meta_filter($post_meta) {
    	$post_meta = '[post_categories before="Categories: "] [post_tags before="Tagged: "]';
    	return $post_meta;
    }

    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75214

    vangelisbel
    Member
    Post count: 21

    Unfortunately no change once again.
    I have one bracket at the end of the code, right?

    #75216

    nutsandbolts
    Keymaster
    Post count: 3187

    Yep. That works sitewide on the test site – every post, every page, every archive and category page…. This is going to drive me crazy.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75217

    vangelisbel
    Member
    Post count: 21

    me too.. I also had a problem with the default layout. If I select the full-width one as the default and want the sidebar one only in some pages, it doesn’t work.

    I had to select the sidebar layout as the default and select in most of the pages the full-width layout as a custom choice.

    Do you think there might be something wrong with my theme installation?

    Should I install the original theme again and redo all the customisations?

    #75218

    nutsandbolts
    Keymaster
    Post count: 3187

    Try deactivating all non-Genesis plugins first to see if that works. And just to be sure, you aren’t using the Simple Edits plugin, correct?


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75220

    nutsandbolts
    Keymaster
    Post count: 3187

    Also, do you have a CDN or Cloudflare enabled through your Dreamhost account? If so, you may need to clear those caches.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #75223

    vangelisbel
    Member
    Post count: 21

    No, I don’t have a CND enabled. I don’t think that it’s a cache thing, because I did some other functions.php customisations and all of them appeared once I reloaded the page. It’s the first time that a change I do, doesn’t show up..

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.