Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter marty84

    (@marty84)

    does not count even with views:

    do_shortcode(“[post-views]”, $post_id)

    Plugin Author dFactory

    (@dfactory)

    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

    (@marty84)

    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

    (@marty84)

    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

    (@marty84)

    I enter the code in the red rectangle but the number of visits shows all over and not individually. Why?

    Example:
    https://postimg.org/image/7k9u7lhhn/

    Plugin Author dFactory

    (@dfactory)

    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.