Community Forums › Forums › Archived Forums › Design Tips and Tricks › Change "Filed Under" in Sixteen Nine Theme
Tagged: post meta, Sixteen Nine
- This topic has 18 replies, 2 voices, and was last updated 10 years, 5 months ago by vangelisbel.
-
AuthorPosts
-
November 23, 2013 at 9:10 am #75188vangelisbelMember
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
http://www.mykonosphotographer.com/?page_id=48
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;
}}November 23, 2013 at 9:13 am #75190nutsandboltsMemberChange this:
[post_categories before="Filed Under: "]
to this:
[post_categories before="Categories: "]
and that should get it working. 🙂
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 9:15 am #75191vangelisbelMemberIm 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?
November 23, 2013 at 9:36 am #75198nutsandboltsMemberI 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 9:41 am #75201vangelisbelMemberHi 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' ),
) );November 23, 2013 at 9:46 am #75206nutsandboltsMemberYep, 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 9:47 am #75207nutsandboltsMemberYou 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 9:52 am #75210vangelisbelMemberI have no caching plugins.
I changed the permalinks, but still no change..
I can't really understand why though...November 23, 2013 at 9:56 am #75212nutsandboltsMemberOkay, 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:02 am #75214vangelisbelMemberUnfortunately no change once again.
I have one bracket at the end of the code, right?November 23, 2013 at 10:04 am #75216nutsandboltsMemberYep. 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:08 am #75217vangelisbelMemberme 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?
November 23, 2013 at 10:10 am #75218nutsandboltsMemberTry 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/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:11 am #75220nutsandboltsMemberAlso, do you have a CDN or Cloudflare enabled through your Dreamhost account? If so, you may need to clear those caches.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:15 am #75223vangelisbelMemberNo, 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..
November 23, 2013 at 10:17 am #75224nutsandboltsMemberI think I would open a support ticket with StudioPress on this one... There's no reason it shouldn't be working unless it's a plugin conflict. If that's been ruled out and you don't have Genesis Simple Edits installed, it's something beyond the realm of forum support.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:25 am #75227vangelisbelMemberOh... Finally! Thanks so much!
It was a plugin issue after all. I did had Simple Edits activated and once I deactivated it, the word "Categories" showed up!
Actually the only reason I downloaded this plugin is because I wasn't confident enough to change the following code myself into © Copyright 2013 Vangelis Photography:
//* 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;}
If you help me with this customisation, I owe you a big one!!!
November 23, 2013 at 10:28 am #75228nutsandboltsMemberMeh, don't bother with their code. Just take that out and replace it with this:
//* Change the footer text add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter'); function sp_footer_creds_filter( $creds ) { $creds = '[footer_copyright] Vangelis Photography'; return $creds; }
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 23, 2013 at 10:36 am #75229vangelisbelMemberThanks so much! You're the best!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.