Shortcode cannot be used twice in different pages
-
Trying to put two different shortcodes in separate page templates is not working. Both pages will display the top posts on the first visited page that contains the shortcode.
Example
Page 1:
<?php echo do_shortcode( '[google_top_content pageviews=5 number=10 contentfilter=post showhome=no time=2628000]' ); ?>
Page 2:
<?php echo do_shortcode( '[google_top_content pageviews=5 number=5 contentfilter=post showhome=no time=2628000]' ); ?>
If page 2 is the first one which gets visited, both page 1 and page 2 will show 5 posts.
https://wordpress.org/plugins/google-analytics-top-posts-widget/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Shortcode cannot be used twice in different pages’ is closed to new replies.