Hi @INcroatia,
To add the multiple categories, please add the following code in place of if(is_category( ‘Your Category Name’ )),
if(is_category( 'Your Category Name' ) || if(is_category( 'Your Category Name' )) || if(is_category( 'Your Category Name' )))
or else you can use an array to add your multiple page titles
if(is_category( array( 'Your Category Name 1', 'Your Category Name 2', 'Your Category Name 3' ) ))
The code will look like:
function alternate_text( $translated_text, $text, $domain )
{
if(is_category( array( 'Your Category Name 1', 'Your Category Name 2', 'Your Category Name 3' ) )) //change this according to your need
{
switch ( $translated_text )
{
case 'View Post' :
$translated_text = __( 'Your Custom View Post Text', '__x__' );
break;
}
}
return $translated_text;
}
add_filter( 'gettext', 'alternate_text', 20, 3 );
Hope it works.
Thanks