ThemeShaper Forums » Thematic

How to change the search text in the Search Widget

(18 posts)
  • Started 9 years ago by hally
  • Latest reply from Chris
  • This topic is not resolved
  1. hally
    Member

    Hello guys,

    I trying to find out how to alter the text 'To search, type and hit enter' text in the search widget. I thought that I could change the text value in the widget-extensions.php file but it seems that is not working. So I don't know what I need to do to change the value.

    Posted 9 years ago #
  2. amygail
    Member

  3. hally
    Member

    Hello amygail

    Do you know what file that the function for the change of the search input text goes into?

    Posted 9 years ago #
  4. Hi,

    the mentioned code goes into your child theme's functions.php.

    Chris

    Posted 9 years ago #
  5. hally
    Member

    When i enter the code as seen in the functions.php file and upload it to my child theme I don't get a blank screen.

    Posted 9 years ago #
  6. hally
    Member

    Before I tried this technique I tried to alter the widgets-extensions.php file but changing the value didn't work either. I really a hard problem to solve.

    Posted 9 years ago #
  7. .. this is caused by a php error .. could you please post your functions.php

    Chris

    Posted 9 years ago #
  8. hally
    Member

    Here it is below.

    <?php

    // Getting Theme and Child Theme Data
    // Credits: Joern Kretzschmar

    $themeData = get_theme_data(TEMPLATEPATH . '/style.css');
    $version = trim($themeData['Version']);
    if(!$version)
    $version = "unknown";

    $ct=get_theme_data(STYLESHEETPATH . '/style.css');
    $templateversion = trim($ct['Version']);
    if(!$templateversion)
    $templateversion = "unknown";

    // set theme constants
    define('THEMENAME', $themeData['Title']);
    define('THEMEAUTHOR', $themeData['Author']);
    define('THEMEURI', $themeData['URI']);
    define('THEMATICVERSION', $version);

    // set child theme constants
    define('TEMPLATENAME', $ct['Title']);
    define('TEMPLATEAUTHOR', $ct['Author']);
    define('TEMPLATEURI', $ct['URI']);
    define('TEMPLATEVERSION', $templateversion);

    // load jQuery
    wp_enqueue_script('jquery');

    // Path constants
    define('THEMELIB', TEMPLATEPATH . '/library');

    // Create Theme Options Page
    require_once(THEMELIB . '/extensions/theme-options.php');

    // Get the page number
    require_once(THEMELIB . '/extensions/page-numbers.php');

    // Load widgets
    require_once(THEMELIB . '/extensions/widgets.php');

    // Load custom theme hooks and filters
    require_once(THEMELIB . '/extensions/hooks-filters.php');

    // Load the Comments Template functions and callbacks
    require_once(THEMELIB . '/extensions/discussion.php');

    // Add Dynamic Contextual Semantic Classes
    require_once(THEMELIB . '/extensions/dynamic-classes.php');

    // Need a little help from our helper functions
    require_once(THEMELIB . '/extensions/helpers.php');

    // Load scripts
    require_once(THEMELIB . '/extensions/scripts.php');

    // Produces an avatar image with the hCard-compliant photo class for author info
    require_once(THEMELIB . '/extensions/author-info-avatar.php');

    // Load shortcodes
    require_once(THEMELIB . '/extensions/shortcodes.php');

    // Adds filters for the description/meta content in archives.php
    add_filter( 'archive_meta', 'wptexturize' );
    add_filter( 'archive_meta', 'convert_smilies' );
    add_filter( 'archive_meta', 'convert_chars' );
    add_filter( 'archive_meta', 'wpautop' );

    // Remove the WordPress Generator – via http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/
    function thematic_remove_generators() { return ''; }
    add_filter('the_generator','thematic_remove_generators');

    // Translate, if applicable
    load_theme_textdomain('thematic', ABSPATH . 'wp-content/themes/thematic/library/languages');

    // Filter away the default scripts loaded with Thematic
    function childtheme_head_scripts() {
    // Abscence makes the heart grow fonder
    }
    add_filter('thematic_head_scripts','childtheme_head_scripts');

    //Change search box text
    function childtheme_search_value() {
    return "Enter your changed text here..";
    }
    add_filter('search_field_value', 'childtheme_search_value');

    //Change search box text
    function childtheme_search_value() {
    return "Enter your changed text here..";
    }
    add_filter('search_field_value', 'childtheme_search_value');

    //Change search box text
    function childtheme_search_value() {
    return "Enter your changed text here..";
    }
    add_filter('search_field_value', 'childtheme_search_value');

    ?>

    Posted 9 years ago #
  9. .. you included the childtheme_search_value() two times .. remove one and it should work.

    Let me know, if this works or not .. will be at home in approx. 20 minutes .. then I can check it on my system.

    Chris

    Posted 9 years ago #
  10. hally
    Member

    Sorry I sent you the wrong functions.php file. Here is the right one.

    <?php

    // Getting Theme and Child Theme Data
    // Credits: Joern Kretzschmar

    $themeData = get_theme_data(TEMPLATEPATH . '/style.css');
    $version = trim($themeData['Version']);
    if(!$version)
    $version = "unknown";

    $ct=get_theme_data(STYLESHEETPATH . '/style.css');
    $templateversion = trim($ct['Version']);
    if(!$templateversion)
    $templateversion = "unknown";

    // set theme constants
    define('THEMENAME', $themeData['Title']);
    define('THEMEAUTHOR', $themeData['Author']);
    define('THEMEURI', $themeData['URI']);
    define('THEMATICVERSION', $version);

    // set child theme constants
    define('TEMPLATENAME', $ct['Title']);
    define('TEMPLATEAUTHOR', $ct['Author']);
    define('TEMPLATEURI', $ct['URI']);
    define('TEMPLATEVERSION', $templateversion);

    // load jQuery
    wp_enqueue_script('jquery');

    // Path constants
    define('THEMELIB', TEMPLATEPATH . '/library');

    // Create Theme Options Page
    require_once(THEMELIB . '/extensions/theme-options.php');

    // Load widgets
    require_once(THEMELIB . '/extensions/widgets.php');

    // Load custom header extensions
    require_once(THEMELIB . '/extensions/header-extensions.php');

    // Load custom content filters
    require_once(THEMELIB . '/extensions/content-extensions.php');

    // Load custom Comments filters
    require_once(THEMELIB . '/extensions/comments-extensions.php');

    // Load custom Widgets
    require_once(THEMELIB . '/extensions/widgets-extensions.php');

    // Load the Comments Template functions and callbacks
    require_once(THEMELIB . '/extensions/discussion.php');

    // Load custom sidebar hooks
    require_once(THEMELIB . '/extensions/sidebar-extensions.php');

    // Load custom footer hooks
    require_once(THEMELIB . '/extensions/footer-extensions.php');

    // Add Dynamic Contextual Semantic Classes
    require_once(THEMELIB . '/extensions/dynamic-classes.php');

    // Need a little help from our helper functions
    require_once(THEMELIB . '/extensions/helpers.php');

    // Load shortcodes
    require_once(THEMELIB . '/extensions/shortcodes.php');

    // Adds filters for the description/meta content in archives.php
    add_filter( 'archive_meta', 'wptexturize' );
    add_filter( 'archive_meta', 'convert_smilies' );
    add_filter( 'archive_meta', 'convert_chars' );
    add_filter( 'archive_meta', 'wpautop' );

    // Remove the WordPress Generator – via http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/
    function thematic_remove_generators() { return ''; }
    add_filter('the_generator','thematic_remove_generators');

    // Translate, if applicable
    load_theme_textdomain('thematic', THEMELIB . '/languages');

    $locale = get_locale();
    $locale_file = THEMELIB . "/languages/$locale.php";
    if ( is_readable($locale_file) )
    require_once($locale_file);

    //Change search box text
    function childtheme_search_value() {
    return "Enter your changed text here..";
    }
    add_filter('search_field_value', 'childtheme_search_value');
    ?>

    Posted 9 years ago #
  11. hally
    Member

    But when I uploaded it is still giving blank screen. I appreciate you helping me out.

    Posted 9 years ago #
  12. This one works with Thematic 0.9.5.1:

    <?php
    
    // Getting Theme and Child Theme Data
    // Credits: Joern Kretzschmar
    
    $themeData = get_theme_data(TEMPLATEPATH . '/style.css');
    $version = trim($themeData['Version']);
    if(!$version)
        $version = "unknown";
    
    $ct=get_theme_data(STYLESHEETPATH . '/style.css');
    $templateversion = trim($ct['Version']);
    if(!$templateversion)
        $templateversion = "unknown";
    
    // set theme constants
    define('THEMENAME', $themeData['Title']);
    define('THEMEAUTHOR', $themeData['Author']);
    define('THEMEURI', $themeData['URI']);
    define('THEMATICVERSION', $version);
    
    // set child theme constants
    define('TEMPLATENAME', $ct['Title']);
    define('TEMPLATEAUTHOR', $ct['Author']);
    define('TEMPLATEURI', $ct['URI']);
    define('TEMPLATEVERSION', $templateversion);
    
    // load jQuery
    wp_enqueue_script('jquery');
    
    // Path constants
    define('THEMELIB', TEMPLATEPATH . '/library');
    
    // Create Theme Options Page
    require_once(THEMELIB . '/extensions/theme-options.php');
    
    // Load widgets
    require_once(THEMELIB . '/extensions/widgets.php');
    
    // Load custom header extensions
    require_once(THEMELIB . '/extensions/header-extensions.php');
    
    // Load custom content filters
    require_once(THEMELIB . '/extensions/content-extensions.php');
    
    // Load custom Comments filters
    require_once(THEMELIB . '/extensions/comments-extensions.php');
    
    // Load custom Widgets
    require_once(THEMELIB . '/extensions/widgets-extensions.php');
    
    // Load the Comments Template functions and callbacks
    require_once(THEMELIB . '/extensions/discussion.php');
    
    // Load custom sidebar hooks
    require_once(THEMELIB . '/extensions/sidebar-extensions.php');
    
    // Load custom footer hooks
    require_once(THEMELIB . '/extensions/footer-extensions.php');
    
    // Add Dynamic Contextual Semantic Classes
    require_once(THEMELIB . '/extensions/dynamic-classes.php');
    
    // Need a little help from our helper functions
    require_once(THEMELIB . '/extensions/helpers.php');
    
    // Load shortcodes
    require_once(THEMELIB . '/extensions/shortcodes.php');
    
    // Adds filters for the description/meta content in archives.php
    add_filter( 'archive_meta', 'wptexturize' );
    add_filter( 'archive_meta', 'convert_smilies' );
    add_filter( 'archive_meta', 'convert_chars' );
    add_filter( 'archive_meta', 'wpautop' );
    
    // Remove the WordPress Generator – via http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/
    function thematic_remove_generators() { return ''; }
    add_filter('the_generator','thematic_remove_generators');
    
    // Translate, if applicable
    load_theme_textdomain('thematic', THEMELIB . '/languages');
    
    $locale = get_locale();
    $locale_file = THEMELIB . "/languages/$locale.php";
    if ( is_readable($locale_file) )
    	require_once($locale_file);
    
    	//Change search box text
    function childtheme_search_value() {
    return "Enter your changed text here..";
    }
    add_filter('search_field_value', 'childtheme_search_value');
    
    ?>
    <?php
    
    // Getting Theme and Child Theme Data
    // Credits: Joern Kretzschmar
    
    $themeData = get_theme_data(TEMPLATEPATH . '/style.css');
    $version = trim($themeData['Version']);
    if(!$version)
        $version = "unknown";
    
    $ct=get_theme_data(STYLESHEETPATH . '/style.css');
    $templateversion = trim($ct['Version']);
    if(!$templateversion)
        $templateversion = "unknown";
    
    // set theme constants
    define('THEMENAME', $themeData['Title']);
    define('THEMEAUTHOR', $themeData['Author']);
    define('THEMEURI', $themeData['URI']);
    define('THEMATICVERSION', $version);
    
    // set child theme constants
    define('TEMPLATENAME', $ct['Title']);
    define('TEMPLATEAUTHOR', $ct['Author']);
    define('TEMPLATEURI', $ct['URI']);
    define('TEMPLATEVERSION', $templateversion);
    
    // load jQuery
    wp_enqueue_script('jquery');
    
    // Path constants
    define('THEMELIB', TEMPLATEPATH . '/library');
    
    // Create Theme Options Page
    require_once(THEMELIB . '/extensions/theme-options.php');
    
    // Load widgets
    require_once(THEMELIB . '/extensions/widgets.php');
    
    // Load custom header extensions
    require_once(THEMELIB . '/extensions/header-extensions.php');
    
    // Load custom content filters
    require_once(THEMELIB . '/extensions/content-extensions.php');
    
    // Load custom Comments filters
    require_once(THEMELIB . '/extensions/comments-extensions.php');
    
    // Load custom Widgets
    require_once(THEMELIB . '/extensions/widgets-extensions.php');
    
    // Load the Comments Template functions and callbacks
    require_once(THEMELIB . '/extensions/discussion.php');
    
    // Load custom sidebar hooks
    require_once(THEMELIB . '/extensions/sidebar-extensions.php');
    
    // Load custom footer hooks
    require_once(THEMELIB . '/extensions/footer-extensions.php');
    
    // Add Dynamic Contextual Semantic Classes
    require_once(THEMELIB . '/extensions/dynamic-classes.php');
    
    // Need a little help from our helper functions
    require_once(THEMELIB . '/extensions/helpers.php');
    
    // Load shortcodes
    require_once(THEMELIB . '/extensions/shortcodes.php');
    
    // Adds filters for the description/meta content in archives.php
    add_filter( 'archive_meta', 'wptexturize' );
    add_filter( 'archive_meta', 'convert_smilies' );
    add_filter( 'archive_meta', 'convert_chars' );
    add_filter( 'archive_meta', 'wpautop' );
    
    // Remove the WordPress Generator – via http://blog.ftwr.co.uk/archives/2007/10/06/improving-the-wordpress-generator/
    function thematic_remove_generators() { return ''; }
    add_filter('the_generator','thematic_remove_generators');
    
    // Translate, if applicable
    load_theme_textdomain('thematic', THEMELIB . '/languages');
    
    $locale = get_locale();
    $locale_file = THEMELIB . "/languages/$locale.php";
    if ( is_readable($locale_file) )
    	require_once($locale_file);
    
    	//Change search box text
    function childtheme_search_value() {
    return "Enter your changed text here..";
    }
    add_filter('search_field_value', 'childtheme_search_value');
    
    ?>
    Posted 9 years ago #
  13. hally
    Member

    Hmm I am still getting blank screen. Maybe it is because some of my files I am using in child theme are older from previous version of thematic

    Posted 9 years ago #
  14. hally
    Member

    I seem to get blank even when I upload the function.php file to the theme. Even if I remove the search input text function. So I don't know why that is occuring.

    Posted 9 years ago #
  15. hally
    Member

    Does anyone know why if I upload the functions.php file to theme this would occur regardless if I have the search text input function added.

    Posted 9 years ago #
  16. Please check, if there are any characters, blanks, CRs, or LFs after the closing '?>'.

    .. or try to remove the closing '?>'

    Posted 9 years ago #
  17. hally
    Member

    I checked but the same problem. However, when I upload the search text input function alteration in the functions.php file to thematic which isn't my child theme it works. But if I upload the same file to the my child theme then the site goes blank again.

    I guess the only solution is for me just to upload the change to the thematic theme folder rather than my child theme for me to see the search change

    Posted 9 years ago #
  18. Could you zip Thematic and your child theme and send it over to chris (at) wupperpiraten (dot) de

    This is something pretty weird!

    Chris

    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.