{"id":3526577,"date":"2013-03-04T16:18:40","date_gmt":"2013-03-04T16:18:40","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/child-functionphp\/"},"modified":"2016-08-20T22:27:16","modified_gmt":"2016-08-20T22:27:16","slug":"child-functionphp","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/child-functionphp\/","title":{"rendered":"Child function.php"},"content":{"rendered":"<p>Hi,<br \/>\nThe learning curve continues!<br \/>\nI am trying to create a child function.php, I have looked at the Codex page and just need some clarification please.<\/p>\n<p>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.<\/p>\n<p>I know how to delete the text I don&#8217;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<\/p>\n<p>The parent .php looks like this;<\/p>\n<pre><code>function pinboard_current_location() {\n\tglobal $pinboard_page_template;\n\tif ( ! ( is_home() &amp;&amp; ! is_paged() ) &amp;&amp; ! is_singular() || isset( $pinboard_page_template ) ) {\n\t\tif( is_author() )\n\t\t\t$archive = &#039;author&#039;;\n\t\telseif( is_category() || is_tag() ) {\n\t\t\t$archive = get_queried_object()-&gt;taxonomy;\n\t\t\t$archive = str_replace( &#039;post_&#039;, &#039;&#039;, $archive );\n\t\t} else\n\t\t\t$archive = &#039;&#039;; ?&gt;\n\t\t&lt;hgroup id=&quot;current-location&quot;&gt;\n\t\t\t&lt;h6 class=&quot;prefix-text&quot;&gt;&lt;?php _e( &#039;Currently browsing&#039;, &#039;pinboard&#039; ); ?&gt; &lt;?php echo $archive;<\/code><\/pre>\n<p>The text I wish to remove is on the last two lines; &#8216;Currently Browsing&#8217;<\/p>\n<p>How much\/little of the above code do I need to put into the child .php?<\/p>\n<p>Finally, on the Codex page it says I can declare conditionally, it gives this as an example. <\/p>\n<pre><code>if ( ! function_exists( &#039;theme_special_nav&#039; ) ) {\n    function theme_special_nav() {\n        \/\/  Do something.\n    }\n}<\/code><\/pre>\n<p>Is this relevant for the following addition I wish to make;<\/p>\n<pre><code>function replace_howdy( $wp_admin_bar ) {\n $my_account=$wp_admin_bar-&gt;get_node(&#039;my-account&#039;);\n $newtitle = str_replace( &#039;Howdy,&#039;, &#039;Hello&#039;, $my_account-&gt;title );\n $wp_admin_bar-&gt;add_node( array(\n &#039;id&#039; =&gt; &#039;my-account&#039;,\n &#039;title&#039; =&gt; $newtitle,\n ) );\n }\n add_filter( &#039;admin_bar_menu&#039;, &#039;replace_howdy&#039;,25 );<\/code><\/pre>\n<p><em>[Please post code &amp; markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum&#8217;s parser.]<\/em><\/p>\n<p>If so what would I replace the &#8216;theme_special_nav&#8217; with, or have I got that totally wrong?<\/p>\n<p>Long query I know, sorry.  I am trying to find a local &#8216;buddy&#8217; to mentor me on things WordPress!<\/p>\n<p>Cheers<\/p>\n<p>John<\/p>\n","protected":false},"template":"","class_list":["post-3526577","topic","type-topic","status-closed","hentry","topic-tag-child","topic-tag-function-php"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/3526577","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/3526577\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=3526577"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}