wordpress if statement error not inserting php code required -
i "trying" work on wordpress site coming against issue if/else statement. below code:
<?php if(is_page(9)): 'get_new_royalslider(1)'; else: echo '<p>other content</p>'; endif; ?>
i trying insert php code given royalslide . doing part right ? can else content load in other pages part working.
thanks
changing code to
<?php if(is_page(9)): echo get_new_royalslider(1); else: echo '<p>other content</p>'; endif; ?>
or
<?php if(is_page(9)): echo do_shortcode('[new_royalslider id="1"]'); else: echo '<p>other content</p>'; endif; ?>
should fix problem. either way should work you.
Comments
Post a Comment