Have different texts on the Featured Pages Buttons

Last Reviewed: 28-Aug-15 (3.4.8) 3.1-3.4.*

If you need to have different texts on the Featured Pages Buttons, here are two snippets to do it the css or php way.

 

The CSS way

Where to copy/paste this code?

NoteSince Customizr 3.3.1 (Customizr-Pro 1.0.12), because of new wp themes guidelines, you cannot use single (double) quotes in the Custom CSS in customizer. Use a Child Theme.

The simplest way is to use the Custom CSS section of the customizer option screen. If you have many customizations to make in CSS and PHP, then We strongly recommend you create a child theme. Everything you need to know about creating a child theme with Customizr here.

Step 1: In your WP admin, go in Appearance >Customize and open the Front Page panel, find the Button text box under FEATURED PAGES OPTIONS and remove all text from it leaving it blank.

Step 2: Add the following CSS:

/* START OF Have different texts on the Featured Pages Buttons */
.fp-one .btn.btn-primary.fp-button:after {
  content:"Read More 1";  /* Change to required text */
}
.fp-two .btn.btn-primary.fp-button:after {
  content:"Read More 2";  /* Change to required text */
}
.fp-three .btn.btn-primary.fp-button:after {
  content:"Read More 3";  /* Change to required text */
}
/* END OF Have different texts on the Featured Pages Buttons */

Featured Pages Unlimited or PRO user? the CSS is slightly different :

/* START OF Have different texts on the Featured Pages Buttons */
.fp-one .fpc-btn:after {
  content:"Read More 1";  /* Change to required text */
}
.fp-two .fpc-btn:after {
  content:"Read More 2";  /* Change to required text */
}
.fp-three .fpc-btn:after {
  content:"Read More 3";  /* Change to required text */
}
/* END OF Have different texts on the Featured Pages Buttons */

 

 

The PHP way

Where to copy/paste this code?
We strongly recommend you create a child theme and add this to the Child Theme functions.php.
Download a start-up child theme here.

Remember: you shouldn’t edit the theme’s functions.php.

// START OF Have different texts on the Featured Pages Buttons
add_filter( 'tc_fp_button_text' , 'my_button_text' , 10 , 2 );
function my_button_text( $original_text , $fp_id ) {
    $my_texts = array(
        'one'   => 'Read More 1', 
        'two'   => 'Read More 2', 
        'three' => 'Read More 3' 
    );
    return isset( $my_texts[$fp_id] ) ? $my_texts[$fp_id] : $original_text ;
}
// END OF Have different texts on the Featured Pages Buttons

Featured Pages Unlimited or PRO user? the php code is slightly different :

// START OF Have different texts on the Featured Pages Buttons
add_filter( 'fpc_button_text' , 'my_button_text' , 10 , 2 );
function my_button_text( $original_text , $fp_id ) {
    $my_texts = array(
        'one'   => 'Read More 1', 
        'two'   => 'Read More 2', 
        'three' => 'Read More 3' 
    );
    return isset( $my_texts[$fp_id] ) ? $my_texts[$fp_id] : $original_text ;
}
// END OF Have different texts on the Featured Pages Buttons

11 thoughts on “Have different texts on the Featured Pages Buttons”

Comments are closed.