Link to home
Start Free TrialLog in
Avatar of vcantave
vcantaveFlag for United States of America

asked on

Wordpress Read More Link

Hello!  I'm working on this site in wordpress 2.7.1.:  www.blumag.com  and I'm attempting to change after excerpts wherever it says "Read More -->" to say "Click to read on..."  but every time I try to edit the index.php to change the "more" text it still reads exactly the same

Also, it seems that for whatever reason, not only do I have the "Read More" protocol coming up, I have (more...) appearing right before the link.  Someone please help me clean this up... it looks crazy...

Thanks in advance!
Avatar of gamma1983
gamma1983
Flag of United States of America image

Avatar of vcantave

ASKER

Thanks for the link... but I've already done that... I'm IN the index.php file changing the code and nothing is taking...
Just to elaborate - I've changed it in both places (the archive.php and the index.php) and no changes have taken place on the site as a result.  Also, it doesn't address the issue I'm having with the extra (more...) that appears before the actual link.
can you copy and paste what you have?
Sure.  I've attached the index.php as well as the home.php pages (which are all the places besides the archive.php  that the read more link is referenced).


HOME::
 
<?php get_header(); ?>
 
 
 
<div id="content">
 
 
 
	<div id="homepage">
 
    
 
    	<?php /*Check for the 'gallery_styles' function. if it's there, then include it. If not, do nothing*/ ?>
 
		<?php if (function_exists('gallery_styles')) : ?>
 
		
 
        <div id="homepagetop">
 
			
 
            <div class="featuredtop">
 
            
 
				<?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?>
 
                
 
			</div>
 
            
 
		</div>
 
<!--To define the 468x60 ad, go to your WP dashboard and go to Appearance > Widgets. Select 468x60 Post Banner and then enter your add code into a text widget-->
 
                
 
        <div class="postwidget">
 
			
 
				<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('468x60 Post Banner') ) : ?>  
 
<center><a href="http://www.blumag.com"><img src="<?php bloginfo('template_url'); ?>/images/468x60.gif" alt="Winsor Pilates" /></a></center><?php endif; ?>
 
          
 
        </div>				
 
        
 
		<?php endif; ?>
 
					
 
			<div id="homepagebottom">
 
		
 
			<div class="hpbottom">
 
			<?php $feature_cat_3 = get_option('lifestyle_feature_cat_3'); $feature_cat_3_num = get_option('lifestyle_feature_cat_3_num'); if(!$feature_cat_3) $feature_cat_3 = 1; //setting a default ?>
 
			<h3>blugrams :: a daily dose</h3>
 
	
 
				<!--This is where the thumbnails are found for the homepage bottom section - note the custom field name for this image is "hpbottom". Recommended image size is 70x70, as the stylesheet is written for this size.-->
 
				
 
				<?php $recent = new WP_Query("cat=".$feature_cat_3."&showposts=".$feature_cat_3_num); while($recent->have_posts()) : $recent->the_post();?>
 
				<?php if( get_post_meta($post->ID, "hpbottom", true) ): ?>
 
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "hpbottom", true); ?>" alt="<?php the_title(); ?>" /></a>
 
				<?php else: ?>
 
				<?php endif; ?>				
 
				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
 
				<?php the_content_limit(350, ""); ?>
 
<div style="padding:0px 0px 10px 0px; clear:both;"></div> 
 
				
 
				<?php endwhile; ?>
 
 
 
			
 
			</div>
 
		
 
		</div>
 
<div id="homepageleft">
 
			<div class="hpfeatured">
 
			<?php $feature_cat_1 = get_option('lifestyle_feature_cat_1'); $feature_cat_1_num = get_option('lifestyle_feature_cat_1_num'); if(!$feature_cat_1) $feature_cat_1 = 1; //setting a default ?>
 
			<h3><?php echo cat_id_to_name($feature_cat_1); ?></h3>
 
			
 
				<!--This is where the thumbnails are found for the homepage bottom section - note the custom field name for this image is "thumbnail". Recommended image size is 70x70, as the stylesheet is written for this size.-->
 
                
 
				<?php $recent = new WP_Query("cat=".$feature_cat_1."&showposts=".$feature_cat_1_num); while($recent->have_posts()) : $recent->the_post();?>
 
				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
 
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
 
				<?php else: ?>
 
				<?php endif; ?>				
 
				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
 
				<?php the_content_limit(80, "[Click to read on]"); ?>
 
				
 
				<div style="padding:0px 0px 10px 0px; clear:both;"></div> 
 
				
 
				<?php endwhile; ?>
 
				
 
					
 
			</div>			
 
				
 
		</div>
 
		
 
		<div id="homepageright">
 
		
 
			<div class="hpfeatured">
 
			<?php $feature_cat_2 = get_option('lifestyle_feature_cat_2'); $feature_cat_2_num = get_option('lifestyle_feature_cat_2_num'); if(!$feature_cat_2) $feature_cat_2 = 1; //setting a default ?>
 
			<h3><?php echo cat_id_to_name($feature_cat_2); ?></h3>
 
			
 
				<!--This is where the thumbnails are found for the homepage bottom section - note the custom field name for this image is "thumbnail". Recommended image size is 70x70, as the stylesheet is written for this size.-->
 
			
 
				<?php $recent = new WP_Query("cat=".$feature_cat_2."&showposts=".$feature_cat_2_num); while($recent->have_posts()) : $recent->the_post();?>
 
				<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
 
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
 
				<?php else: ?>
 
				<?php endif; ?>				
 
				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>				
 
				<?php the_content_limit(80, "[Click to read on]"); ?>
 
								
 
		<div style="padding:0px 0px 10px 0px; clear:both;"></div>
 
				
 
				<?php endwhile; ?>
 
								
 
				
 
				
 
			</div>		
 
			
 
		</div>
 
		
 
			
 
	</div>
 
	
 
<?php include(TEMPLATEPATH."/sidebar.php");?>
 
		
 
</div>
 
 
 
<!-- The main column ends  -->
 
 
 
<?php get_footer(); ?>
 
 
 
 
 
 
INDEX:
 
<?php get_header(); ?>
 
 
 
<div id="content">
 
 
 
	<div id="contentleft">
 
	
 
		<div class="postarea">
 
		
 
		<?php include(TEMPLATEPATH."/breadcrumb.php");?>
 
 
 
	
 
			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
			<h1><?php the_title(); ?></h1>
 
			
 
			<div class="date">
 
			
 
				<div class="dateleft">
 
					<p><span class="time"><?php the_time('F j, Y'); ?></span></p> 
 
				</div>
 
				
 
				<div class="dateright">
 
					<p><span class="icomment"><a href="<?php the_permalink(); ?>#respond"><?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?></a></span></p> 
 
				</div>
 
				
 
			</div>
 
			
 
			<div style="clear:both;"></div>
 
<?php the_content(__('Click to read on'));?><div style="clear:both;"></div>
 
			
 
			<div class="postmeta">
 
				<p><span class="tags">Tags: <?php the_tags('') ?></span></p>
 
			</div>
 
		 			
 
			<!--
 
			<?php trackback_rdf(); ?>
 
			-->
 
			
 
			<?php endwhile; else: ?>
 
			
 
			<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
 
			
 
		</div>
 
	
 
		
 
			
 
		<div class="comments">
 
			<?php comments_template('',true); ?>
 
		</div>
 
		
 
	</div>
 
	
 
<?php include(TEMPLATEPATH."/sidebar.php");?>
 
		
 
</div>
 
 
 
<!-- The main column ends  -->
 
 
 
<?php get_footer(); ?>

Open in new window

You're using Revolution Two's Lifestyle 3.0 theme. Is there a theme-specific setting that affects this? Some themes have design options or settings to make these changes.
Theme-specific support is available here:

http://www.studiopress.com/support/

However, it appears you have to log in to get it.
Yes, I've been to the support forums and for whatever reason, everyone else is able to get it to change simply from the link that gamma1983 posted.  But, like I said... I've BEEN doing that and there's no change.
Do you have any plug-ins installed that might have impact? Had you made any changes when using a previous theme?
These are the only Plugins I have activated:  

Akismet
Featured Content gallery - the flash carousel
Maintenance mode (off)
wordPress.com stats
WP Polls
WP Stats

and none of them have anything to do with the "Read more" protocol...
Previous theme?
Forgive me for saying something that is obvious, but when you change the php files, are they being uploaded to the server, and have you viewed the file on the server to make sure it was uploaded to the right place
Please modify in page.php

thanks
Dosth
http://codex.wordpress.org/Customizing_the_Read_More

Read More is ignored on front (home) page
Please remember that on the home page ( is_home() == TRUE ), the <!--More--> tag is ignored unless you turn on it again using the following code:
global $more;
$more = 0;  
Can you give me your functions.php file? As sometimes its customized there!
Fahdmurtaza:

Here it goes : functions.php
<?php
add_filter('comments_template', 'legacy_comments');
function legacy_comments($file) {
	if(!function_exists('wp_list_comments')) : // WP 2.7-only check
		$file = TEMPLATEPATH . '/legacy.comments.php';
	endif;
 
	return $file;
}
 
//Turn a category ID to a Name
function cat_id_to_name($id) {
	foreach((array)(get_categories()) as $category) {
    	if ($id == $category->cat_ID) { return $category->cat_name; break; }
	}
}
 
include(TEMPLATEPATH."/tools/breadcrumb-navigation-xt.php");
 
if ( function_exists('register_sidebars') )
	register_sidebar(array('name'=>'Sidebar Top',));
	register_sidebar(array('name'=>'Sidebar Bottom Left',));
	register_sidebar(array('name'=>'Sidebar Bottom Right',));
	register_sidebar(array('name'=>'468x60 Header Banner',));
	register_sidebar(array('name'=>'468x60 Post Banner',));
 
$themename = "Lifestyle Theme";
$shortname = "lifestyle";
 
$options = array (
				array(	"name" => "General Settings",
						"type" => "heading"),
				
				array(	"name" => "Featured Top Left",
						"desc" => "This is for the homepage feature area, top-left.<br /><br />",
			    		"id" => $shortname."_feature_cat_1",
			    		"type" => "cat_select"),
				
				array(	"name" => "# of Posts",
						"desc" => "How many posts would you like to include for this category?<br /><br />",
			    		"id" => $shortname."_feature_cat_1_num",
			    		"type" => "text"),
			    		
				array(	"name" => "Featured Top Right",
						"desc" => "This is for the homepage feature area, top-right.<br /><br />",
			    		"id" => $shortname."_feature_cat_2",
			    		"type" => "cat_select"),
			    		
				array(	"name" => "# of Posts",
						"desc" => "How many posts would you like to include for this category?<br /><br />",
			    		"id" => $shortname."_feature_cat_2_num",
			    		"type" => "text"),
			    		
				array(	"name" => "Featured Bottom",
						"desc" => "This is for the homepage feature area, bottom.<br /><br />",
			    		"id" => $shortname."_feature_cat_3",
			    		"type" => "cat_select"),
			    		
				array(	"name" => "# of Posts",
						"desc" => "How many posts would you like to include for this category?<br /><br />",
			    		"id" => $shortname."_feature_cat_3_num",
			    		"type" => "text"),
				
				array(	"name" => "Blog Category",
						"desc" => "This is to configure which category is being used on the Blog Page template.<br /><br />",
			    		"id" => $shortname."_blog_cat_1",
			    		"type" => "cat_select"),
				
				array(	"name" => "# of Posts",
						"desc" => "How many posts would you like to include on each blog page?<br /><br />",
			    		"id" => $shortname."_blog_cat_1_num",
			    		"type" => "text"),																														
);
		
function mytheme_add_admin() {
 
    global $themename, $shortname, $options;
 
    if ( $_GET['page'] == basename(__FILE__) ) {
    
        if ( 'save' == $_REQUEST['action'] ) {
 
                foreach ($options as $value) {
					if($value['type'] != 'multicheck'){
                    	update_option( $value['id'], $_REQUEST[ $value['id'] ] ); 
					}else{
						foreach($value['options'] as $mc_key => $mc_value){
							$up_opt = $value['id'].'_'.$mc_key;
							update_option($up_opt, $_REQUEST[$up_opt] );
						}
					}
				}
 
                foreach ($options as $value) {
					if($value['type'] != 'multicheck'){
                    	if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ]  ); } else { delete_option( $value['id'] ); } 
					}else{
						foreach($value['options'] as $mc_key => $mc_value){
							$up_opt = $value['id'].'_'.$mc_key;						
							if( isset( $_REQUEST[ $up_opt ] ) ) { update_option( $up_opt, $_REQUEST[ $up_opt ]  ); } else { delete_option( $up_opt ); } 
						}
					}
				}
                header("Location: themes.php?page=functions.php&saved=true");
                die;
 
        } else if( 'reset' == $_REQUEST['action'] ) {
 
            foreach ($options as $value) {
				if($value['type'] != 'multicheck'){
                	delete_option( $value['id'] ); 
				}else{
					foreach($value['options'] as $mc_key => $mc_value){
						$del_opt = $value['id'].'_'.$mc_key;
						delete_option($del_opt);
					}
				}
			}
            header("Location: themes.php?page=functions.php&reset=true");
            die;
 
        }
    }
 
    add_theme_page($themename." Options", "$themename Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
 
}
 
function mytheme_admin() {
 
    global $themename, $shortname, $options;
 
    if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings saved.</strong></p></div>';
    if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' settings reset.</strong></p></div>';
    
?>
<div class="wrap">
<h2><?php echo $themename; ?> options</h2>
 
<form method="post">
 
<table class="optiontable">
 
<?php foreach ($options as $value) { 
	
	switch ( $value['type'] ) {
		case 'text':
		option_wrapper_header($value);
		?>
		        <input style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" />
		<?php
		option_wrapper_footer($value);
		break;
		
		case 'select':
		option_wrapper_header($value);
		?>
	            <select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
	                <?php foreach ($value['options'] as $option) { ?>
	                <option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
	                <?php } ?>
	            </select>
		<?php
		option_wrapper_footer($value);
		break;
		
		//////////////////////////////////
		//This is the category select code
		//	Code courtesy of Nathan Rice
		case 'cat_select':
		option_wrapper_header($value);
		$categories = get_categories('hide_empty=0');
		?>
	            <select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
					<?php foreach ($categories as $cat) {
					if ( get_settings( $value['id'] ) == $cat->cat_ID) { $selected = ' selected="selected"'; } else { $selected = ''; }
					$opt = '<option value="' . $cat->cat_ID . '"' . $selected . '>' . $cat->cat_name . '</option>';
					echo $opt; } ?>
	            </select>
		<?php
		option_wrapper_footer($value);
		break;
		//end category select code
		//////////////////////////
		
		case 'textarea':
		$ta_options = $value['options'];
		option_wrapper_header($value);
		?>
				<textarea name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" style="width:400px;height:100px;"><?php 
				if( get_settings($value['id']) != "") {
						echo stripslashes(get_settings($value['id']));
					}else{
						echo $value['std'];
				}?></textarea>
		<?php
		option_wrapper_footer($value);
		break;
 
		case "radio":
		option_wrapper_header($value);
		
 		foreach ($value['options'] as $key=>$option) { 
				$radio_setting = get_settings($value['id']);
				if($radio_setting != ''){
		    		if ($key == get_settings($value['id']) ) {
						$checked = "checked=\"checked\"";
						} else {
							$checked = "";
						}
				}else{
					if($key == $value['std']){
						$checked = "checked=\"checked\"";
					}else{
						$checked = "";
					}
				}?>
	            <input type="radio" name="<?php echo $value['id']; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><?php echo $option; ?><br />
		<?php 
		}
		 
		option_wrapper_footer($value);
		break;
		
		case "checkbox":
		option_wrapper_header($value);
						if(get_settings($value['id'])){
							$checked = "checked=\"checked\"";
						}else{
							$checked = "";
						}
					?>
		            <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
		<?php
		option_wrapper_footer($value);
		break;
 
		case "multicheck":
		option_wrapper_header($value);
		
 		foreach ($value['options'] as $key=>$option) {
	 			$pn_key = $value['id'] . '_' . $key;
				$checkbox_setting = get_settings($pn_key);
				if($checkbox_setting != ''){
		    		if (get_settings($pn_key) ) {
						$checked = "checked=\"checked\"";
						} else {
							$checked = "";
						}
				}else{
					if($key == $value['std']){
						$checked = "checked=\"checked\"";
					}else{
						$checked = "";
					}
				}?>
	            <input type="checkbox" name="<?php echo $pn_key; ?>" id="<?php echo $pn_key; ?>" value="true" <?php echo $checked; ?> /><label for="<?php echo $pn_key; ?>"><?php echo $option; ?></label><br />
		<?php 
		}
		 
		option_wrapper_footer($value);
		break;
		
		case "heading":
		?>
		<tr valign="top"> 
		    <td colspan="2" style="text-align: center;"><h3><?php echo $value['name']; ?></h3></td>
		</tr>
		<?php
		break;
		
		default:
 
		break;
	}
}
?>
 
</table>
 
<p class="submit">
<input name="save" type="submit" value="Save changes" />    
<input type="hidden" name="action" value="save" />
</p>
</form>
<form method="post">
<p class="submit">
<input name="reset" type="submit" value="Reset" />
<input type="hidden" name="action" value="reset" />
</p>
</form>
 
<?php
}
 
function option_wrapper_header($values){
	?>
	<tr valign="top"> 
	    <th scope="row"><?php echo $values['name']; ?>:</th>
	    <td>
	<?php
}
 
function option_wrapper_footer($values){
	?>
	    </td>
	</tr>
	<tr valign="top">
		<td>&nbsp;</td><td><small><?php echo $values['desc']; ?></small></td>
	</tr>
	<?php 
}
 
function mytheme_wp_head() { 
	$stylesheet = get_option('revmag_alt_stylesheet');
	if($stylesheet != ''){?>
 
<?php }
} 
 
add_action('wp_head', 'mytheme_wp_head');
add_action('admin_menu', 'mytheme_add_admin'); 
?>
<?php function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]&gt;', $content);
    $content = strip_tags($content);
 
   if (strlen($_GET['p']) > 0) {
      echo "<p>";
      echo $content;
      echo "&nbsp;<a href='";
      the_permalink();
      echo "'>"."Read More &rarr;</a>";
      echo "</p>";
   }
   else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
        $content = substr($content, 0, $espacio);
        $content = $content;
        echo "<p>";
        echo $content;
        echo "...";
        echo "&nbsp;<a href='";
        the_permalink();
        echo "'>".$more_link_text."</a>";
        echo "</p>";
   }
   else {
      echo "<p>";
      echo $content;
      echo "&nbsp;<a href='";
      the_permalink();
      echo "'>"."Read More &rarr;</a>";
      echo "</p>";
   }
}
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Fahdmurtaza
Fahdmurtaza
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
THIS WORKED FLAWLESSLY!!! Thank you so much FM!!
:) Glad that it worked for you.