Pros / Cons Php Code

Front Support Plugins Support WP Rich Snippets Plugin Pros / Cons Php Code

This topic contains 3 replies, has 2 voices, and was last updated by  Hesham 3 years ago.

  • Author
    Posts
  • #4562

    Hi
    I need the php code to display pros and cons. I will use it inside template file, can you give me the PHP code instead of shortcode [wprs-pros]

  • #4568

    Hesham
    Keymaster

    Sure, you can use this code to display Pros and Cons in your Theme:

    // display Pros
    if ( shortcode_exists( 'wprs-pros' ) ) {
    	// The [wprs-pros] short code exists.
    	do_shortcode('[wprs-pros]');
    }
    
    // display Cons
    if ( shortcode_exists( 'wprs-cons' ) ) {
    	// The [wprs-cons] short code exists.
    	do_shortcode('[wprs-cons]');
    }

    I hope this helps.

  • #4594

    sorry, not worked on my side

  • #4621

    Hesham
    Keymaster

    I am not sure where you are using the code, it should be placed in the single post template file (in your Theme) where you want to display the Pros and Cons.

The forum ‘WP Rich Snippets Plugin’ is closed to new topics and replies.