Title: Shortcode doesn&#039;t work
Last modified: August 30, 2016

---

# Shortcode doesn't work

 *  Resolved [marty84](https://wordpress.org/support/users/marty84/)
 * (@marty84)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/)
 * This shortcode does’nt work
 * `do_shortcode("[post-views]", $post>ID)`
 * what is the shortcodes this plugin?
 * [https://wordpress.org/plugins/post-views-counter/](https://wordpress.org/plugins/post-views-counter/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter [marty84](https://wordpress.org/support/users/marty84/)
 * (@marty84)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666507)
 * does not count even with views:
 * do_shortcode(“[post-views]”, $post_id)
 *  Plugin Author [dFactory](https://wordpress.org/support/users/dfactory/)
 * (@dfactory)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666511)
 * shortcodes don’t accept parameters like that and requires echo:
 * `echo do_shortcode("[post-views]");`
 * or you can use a function
 * `pvc_post_views();`
 * optionally with post id parameter
 * `pvc_post_views( $post->ID );`
 *  Thread Starter [marty84](https://wordpress.org/support/users/marty84/)
 * (@marty84)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666513)
 * I must insert the shortcode here:
 * `postExcerptHTML .= '</div><div class="subhome">' . get_field('sub_title', $post-
   >ID ) . '</div><div class="subhomebold">' . get_field('subtitle_bold', $post-
   >ID ) . '</div><div style="display:block;">' . <strong>do_shortcode('[post-views]',
   $post>ID)</strong> . '</div>'`
 * And doesn’t work with:
 * `pvc_post_views();`
 * or
 * `pvc_post_views( $post->ID )`
 * And I have **w3 total cache.** Is maybe this problem?
 *  Thread Starter [marty84](https://wordpress.org/support/users/marty84/)
 * (@marty84)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666515)
 * errata corrige:
 * postExcerptHTML .= ‘</div><div class=”subhome”>’ . get_field(‘sub_title’, $post-
   >ID ) . ‘</div><div class=”subhomebold”>’ . get_field(‘subtitle_bold’, $post-
   >ID ) . ‘</div><div style=”display:block;”>’ . do_shortcode(‘[post-views]’, $
   post>ID) . ‘</div>’
 *  Thread Starter [marty84](https://wordpress.org/support/users/marty84/)
 * (@marty84)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666518)
 * I enter the code in the red rectangle but the number of visits shows all over
   and not individually. Why?
 * Example:
    [http://postimg.org/image/7k9u7lhhn/](http://postimg.org/image/7k9u7lhhn/)
 *  Plugin Author [dFactory](https://wordpress.org/support/users/dfactory/)
 * (@dfactory)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666675)
 * there are issues with your code syntax:
 * please just try to use plain function as explained above and check the result.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Shortcode doesn't work’ is closed to new replies.

 * ![](https://ps.w.org/post-views-counter/assets/icon-256x256.png?rev=2973820)
 * [Post Views Counter](https://wordpress.org/plugins/post-views-counter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-views-counter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-views-counter/)
 * [Active Topics](https://wordpress.org/support/plugin/post-views-counter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-views-counter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-views-counter/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [dFactory](https://wordpress.org/support/users/dfactory/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/shortcode-doesnt-work-23/#post-6666675)
 * Status: resolved