Jump to content

Archived

This topic is now archived and is closed to further replies.

alexb

Customising functions.php

Recommended Posts

alexb

Dear All -

 

I have downloaded and installed the customise plug-in in order to customise functions.php with the following alternate Search Box text:

add_filter('pagelines_search_form','override_search_form');

                function override_search_form() {

               

                                $searchfield = sprintf('<input type="text" value="" name="s" class="searchfield" placeholder="%s" />', 'SEARCH THE SITE'); // modify here

               

                                $searchform = sprintf('<form method="get" class="searchform" onsubmit="this.submit();return false;" action="%s/" ><fieldset>%s</fieldset></form>', home_url(), $searchfield);

               

                                return $searchform;

                }

However, I don't seem to able to find exactly where you add customisations...I assume it isn't straight into function.php via the Wordpress Editor function, else that defeats the point of the customise plug-in..

 

Can anyone help point me in the right direction please?

 

Alex

Share this post


Link to post
Share on other sites
Simon

The customize plugin has a functions.php, just like a child theme. Thats where you ad custom code.

Share this post


Link to post
Share on other sites
Danny

Thanks for informing us the issue has ben resolved.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
alexb

Well, not quite alas Danny! :p

 

I located the customize functions php for the plugin and pasted the code in but with no effect. It states 'Editing pagelines-customize/functions.php (inactive)'

 

I wonder if this is because this will edit the standard WP search bar, whereas I am using the Nav Bar section?

 

Alex

Share this post


Link to post
Share on other sites
Simon

the inactive is because your editing a plugin using the wordpress editor, and that file is inactive according to wordpress, just ignore it.

Share this post


Link to post
Share on other sites
alexb

Ah thanks...well happy to ignore if the function worked, but I pasted the new function into the customize function/php file, and the Search field still reads 'Search' instead of 'Search the site'...am I missing something stupid?

 

/*
// ====================================================
// add_filter('pagelines_search_form','override_search_form');
 
                function override_search_form() {
 
               
 
                                $searchfield = sprintf('<input type="text" value="" name="s" class="searchfield" placeholder="%s" />', 'SEARCH THE SITE'); // modify here
 
               
 
                                $searchform = sprintf('<form method="get" class="searchform" onsubmit="this.submit();return false;" action="%s/" ><fieldset>%s</fieldset></form>', home_url(), $searchfield);
 
               
 
                                return $searchform;
 
                }
// ====================================================
*/

Share this post


Link to post
Share on other sites

×