How to change the pros/cons heading text

You can change the text for the "Pros" and "Cons" in WPPR to your desired text for your website using the wppr_review_pros_text and wppr_review_cons_text filters. You can also change dynamically the text, having a different one for each review. Below lists how to make the change.

In the examples below replace the  882  value with the ID of the post you want the change to happen. You can find the ID of a post in the URL of the page while editing a post:

I f you'd like to style the output use the following code:

//for pros

function wppr_review_pros_text_html_filter_demo() {
  if ( get_the_ID() == 882 ){
    echo '<span style="font-size:20px; color: #4682B4;">Advantages</span>';
  }else{
    echo '<span style="font-size:20px">Pros</span>';
  }
}

add_filter( 'wppr_review_pros_text','wppr_review_pros_text_html_filter_demo',11 );

//for cons

function wppr_review_cons_text_filter_demo() {
  if (get_the_ID() == 882){
    echo '<span style="font-size:20px">Disadvantages</span>';
  }else{
    echo '<span style="font-size:20px">Cons</span>';
  }
}

add_filter( 'wppr_review_cons_text','wppr_review_cons_text_filter_demo',11 );

For more HTML color codes you can use: https://www.hexcolortool.com/


If you'd just like to change the text then use this code instead:

//for pros

function wppr_review_pros_text_html_filter_demo( $name ) {
  if ( get_the_ID() == 882 ){
    return $name = "Advantages";
  }else{
    return $name = "Pros";
  }
}
add_filter( 'wppr_review_pros_text','wppr_review_pros_text_html_filter_demo',11,1 );

//for cons

function wppr_review_cons_text_filter_demo( $name ) {
  if ( get_the_ID() == 882 ){
    return "Disadvantages";
  }else{
    return $name = "Cons";
  }
  
}
add_filter( 'wppr_review_cons_text','wppr_review_cons_text_filter_demo',11,1 );
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us