Community Forums › Forums › Archived Forums › Design Tips and Tricks › Snippets Not Working
Tagged: functions, hooks, shortcodes
- This topic has 2 replies, 2 voices, and was last updated 9 years, 10 months ago by
medk.
-
AuthorPosts
-
March 28, 2015 at 8:24 pm #145981
medk
MemberHello,
I'm using Genesis 2.1.2 with a child theme that I'm developing and every time I want to customize my theme using some snippets in the functions.php I get nothing especially when removing://* Remove the entry title (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );This function is about removing the entry title, but the entry title will be always there.
The next function is about removing the nav bar and placing it before the header:
//* Reposition the primary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );But it adds the new nav bar without removing the old one so I get two nav bars.
I think it doesn't understand "remove_action"
Any suggestions please?
March 30, 2015 at 3:33 am #146069ᴅᴀᴠɪᴅ
MemberPerhaps you have moved them onto a different priority number earlier in the file? Usually thats the case when this happens to me. I am trying to remove something from a hook, but forgot i had changed the priority earlier in the code.
Other than that I can't think why it wouldn't work.
I love helping creative entrepreneurs build epic things with WP & Genesis.
April 1, 2015 at 8:00 am #146366medk
MemberAbsolutely not the case, I have a very basic child theme with a very basic functions.php :
`<?php
// Start the engineadd_action( 'genesis_setup','genesischild_theme_setup' );
function genesischild_theme_setup() {
//* Add HTML5 markup structure
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );//add_theme_support('html5');
add_theme_support('genesis-responsive-viewport');
add_theme_support('genesis-footer-widgets', 3);
add_theme_support('custom-background');
add_theme_support('post-thumbnails');}
//* Add previous and next post links after entry
add_action( 'genesis_entry_footer', 'genesis_prev_next_post_nav' );//* Customize the credits
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
function sp_footer_creds_text() {
echo '<div class="creds">Copyright © ' . date('Y');
echo ' - Delta sécurité et services - Av. Mohamed V Immeuble Lejri Gafsa 2100, Tunisie</p>';
}// Move image above post title in Genesis Framework 2.0
//remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
//add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );//* Remove the entry title (requires HTML5 theme support)
//remove_action( 'genesis_entry_header', 'genesis_do_post_title' );//* Add a custom image size
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'new-size', 100, 100, true ); //(cropped)
}
add_filter('image_size_names_choose', 'my_image_sizes');
function my_image_sizes($sizes) {
$addsizes = array(
'new-size' => __( 'New Size')
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}//* Modify breadcrumb arguments.
add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' );
function sp_breadcrumb_args( $args ) {
$args['home'] = 'Home';
$args['sep'] = ' / ';
$args['list_sep'] = ', '; // Genesis 1.5 and later
$args['prefix'] = '<div class="breadcrumb">';
$args['suffix'] = '</div>';
$args['heirarchial_attachments'] = true; // Genesis 1.5 and later
$args['heirarchial_categories'] = true; // Genesis 1.5 and later
$args['display'] = true;
$args['labels']['prefix'] = '';
$args['labels']['author'] = 'Archives for ';
$args['labels']['category'] = 'Archives for '; // Genesis 1.6 and later
$args['labels']['tag'] = 'Archives for ';
$args['labels']['date'] = 'Archives for ';
$args['labels']['search'] = 'Search for ';
$args['labels']['tax'] = 'Archives for ';
$args['labels']['post_type'] = 'Archives for ';
$args['labels']['404'] = 'Not found: '; // Genesis 1.5 and later
return $args;
} -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.