Try adding:
function change_protected_text($content) {
$content = str_replace(
'This post is password protected. To view it please enter your password below:',
'ENTER_YOUR_TEXT_HERE',
$content);
return $content;
}
add_filter('the_content','change_protected_text');
to your theme’s function.php file.
Thanks Esmi for the tip …. can you let me know where the best place to put the code in?
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => __('Left Sidebar', 'theme961'),
'before_widget' => ' <div id="%1$s" class="widget %2$s"><div class="widget-bgr">',
'before_title' => ' <div class="title"><div><div><h2>',
'after_title' => ' </h2></div></div></div>',
'after_widget' => ' </div></div>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => __('Right Sidebar', 'theme961'),
'before_widget' => ' <div id="%1$s" class="widget %2$s"><div class="widget-bgr">',
'before_title' => ' <div class="title"><div><div><h2>',
'after_title' => ' </h2></div></div></div>',
'after_widget' => ' </div></div>',
));
// Search
function widget_theme961_search() {
?>
<div class="widget widget_search" id="search">
<div class="widget-bgr">
<div class="title">
<div><div><h2><?php _e('Site Search','theme961'); ?></h2></div></div>
</div>
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>">
<input type="text" class="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <input class="but" type="image" src="<?php bloginfo('stylesheet_directory'); ?>/images/search2.gif" value="submit" />
</form>
</div>
</div>
<?php
}
if ( function_exists('register_sidebar_widget') )
register_sidebar_widget(__('Search'), 'widget_theme961_search');
?>
Try adding it just after the opening <?php
tag at the top of the file.
Remember to press CTRL and F5 simultaneously when viewing the updated page. Or try emptying your browser cache. This should ensure that your web browser fetches a fresh copy of the page rather than serving up an out-dated copy from your own cache.
Hi Esmi,
So appreciate the help… still no luck:( here is the url for what I am trying to change and have just put in some text as test to see if change and has not… should I try putting it elsewhere? Or any other Ideas? Thanks again for your help so far…
http://cirkusprinsessan.net/?page_id=156
<?php function change_protected_text($content) {
$content = str_replace(
'Please contact us at for press access:',
'today',
$content);
return $content;
}
add_filter('the_content','change_protected_text');
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => __('Left Sidebar', 'theme961'),
'before_widget' => ' <div id="%1$s" class="widget %2$s"><div class="widget-bgr">',
'before_title' => ' <div class="title"><div><div><h2>',
'after_title' => ' </h2></div></div></div>',
'after_widget' => ' </div></div>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => __('Right Sidebar', 'theme961'),
'before_widget' => ' <div id="%1$s" class="widget %2$s"><div class="widget-bgr">',
'before_title' => ' <div class="title"><div><div><h2>',
'after_title' => ' </h2></div></div></div>',
'after_widget' => ' </div></div>',
));
// Search
function widget_theme961_search() {
?>
<div class="widget widget_search" id="search">
<div class="widget-bgr">
<div class="title">
<div><div><h2><?php _e('Site Search','theme961'); ?></h2></div></div>
</div>
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>">
<input type="text" class="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <input class="but" type="image" src="<?php bloginfo('stylesheet_directory'); ?>/images/search2.gif" value="submit" />
</form>
</div>
</div>
<?php
}
if ( function_exists('register_sidebar_widget') )
register_sidebar_widget(__('Search'), 'widget_theme961_search');
?>
Check the code I gave up above. You have to enter your text after the text that is normally displayed on a password protected posts in the function.
I Esmi I had tried that first! and no luck which is why I tried the other way… sorry have had a lat night last night! must be getting tired!…. still a no go! May have to give up!
<?php function change_protected_text($content) {
$content = str_replace(
'This post is password protected. To view it please enter your password below:',
'To obtain a password, please contact us at press@cirkusprinsessan.net or ring Maria Tell Saav 070-738 40 22',
$content);
return $content;
}
add_filter('the_content','change_protected_text');