Child function.php
-
Hi,
The learning curve continues!
I am trying to create a child function.php, I have looked at the Codex page and just need some clarification please.There are two changes I wish to make to my child theme, neither radical, more me being fussy and also to help me understand better how things work.
I know how to delete the text I don’t want in the function.php file of the parent, however after an upgrade it obviously reverts back. I therefore want to create a child .php
The parent .php looks like this;
function pinboard_current_location() { global $pinboard_page_template; if ( ! ( is_home() && ! is_paged() ) && ! is_singular() || isset( $pinboard_page_template ) ) { if( is_author() ) $archive = 'author'; elseif( is_category() || is_tag() ) { $archive = get_queried_object()->taxonomy; $archive = str_replace( 'post_', '', $archive ); } else $archive = ''; ?> <hgroup id="current-location"> <h6 class="prefix-text"><?php _e( 'Currently browsing', 'pinboard' ); ?> <?php echo $archive;
The text I wish to remove is on the last two lines; ‘Currently Browsing’
How much/little of the above code do I need to put into the child .php?
Finally, on the Codex page it says I can declare conditionally, it gives this as an example.
if ( ! function_exists( 'theme_special_nav' ) ) { function theme_special_nav() { // Do something. } }
Is this relevant for the following addition I wish to make;
function replace_howdy( $wp_admin_bar ) { $my_account=$wp_admin_bar->get_node('my-account'); $newtitle = str_replace( 'Howdy,', 'Hello', $my_account->title ); $wp_admin_bar->add_node( array( 'id' => 'my-account', 'title' => $newtitle, ) ); } add_filter( 'admin_bar_menu', 'replace_howdy',25 );
[Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]
If so what would I replace the ‘theme_special_nav’ with, or have I got that totally wrong?
Long query I know, sorry. I am trying to find a local ‘buddy’ to mentor me on things WordPress!
Cheers
John
- The topic ‘Child function.php’ is closed to new replies.