This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: Read More buttons

#3043
gregfields
Participant

Jason,
I have some custom code in the functions.php file to change the “Read More” button text on specific categories. For two photo gallery categories it is “View”. All was working perfectly. Recently I had to change one of the photo gallery category names due to a typo. Now in some places the “View” text has reverted to “Read more” even after I updated the functions.php code to the new name. It is behaving as if the database did not update.

On this page the page the button text is displaying properly: sfvedanta.org/category/shanti-ashrama-retreat-photos/

On these pages it is not displaying correctly: sfvedanta.org/resources/photo-galleries/ (notice how the edited category at bottom is displaying “Read more”) and sfvedanta.org/resources/ (scroll down to Photo Galleries)

I used the Builder to create the Resources and Photo Galleries page templates. I verified that they are calling the recently edited category.

Here is the functions.php code:

//This is the function with conditional tags around the "read more" - 
// put this at the very top of child theme's functions file
function themeblvd_blog_content_default( $type ) {
		if( $type == 'content' ) {
			// Show full content
			the_content( themeblvd_get_local('read_more').' →' );
		} else {
			// Show excerpt and read more button
			the_excerpt();
			
			if (is_category(array('lecture-audio','class-audio'))) { 
			echo '<a href="'.get_permalink( get_the_ID() ).'">Listen &rarr;</a>';
			}					
			elseif (is_category(array('memorial-weekend-retreat-photos','shanti-ashrama-retreat-photos'))) { 		    
		    echo '<a href="'.get_permalink( get_the_ID() ).'">View &rarr;</a>';		
			}
			elseif (in_category(array('memorial-weekend-retreat-photos','shanti-ashrama-retreat-photos'))) { 		    
		    echo '<a href="'.get_permalink( get_the_ID() ).'">View &rarr;</a>';		
			}									
			else {	
			echo '<a href="'.get_permalink( get_the_ID() ).'">Read more &rarr;</a>';
			}
		}
	}	
/*-------------------------------------------------------*/
/* Run Theme Blvd framework (required)
/*-------------------------------------------------------*/
require_once ( TEMPLATEPATH . '/framework/themeblvd.php' );

Any insight would be greatly appreciated!
Greg