• Hello,

    I am using Smartline Lite WordPress theme and have installed Post view counter. I want to include the shortcut “echo do_shortcode( ‘[post-views]’ );” of this plugin into smartline_display_postmeta so that to view post views near the date and category name on the top of post. But I don’t know how to do this. Could you please help me to solve this request?

    • This topic was modified 7 years, 6 months ago by elvinmammadov.
Viewing 3 replies - 1 through 3 (of 3 total)
  • what’s the website url?

    Thread Starter elvinmammadov

    (@elvinmammadov)

    website url: teze.aqra.az
    https://teze.aqra.az/az/category/elm/

    I have added the following code near the display_postmeta in content-excerpt.php in theme folder. but it doesn’t stand near date of post and category name. It is shown under them. Note: “Bax?? say?” is “Post view” in our language.

    <div class=”entry-meta postmeta”><?php smartline_display_postmeta();?></div> <?php echo do_shortcode( ‘[post-views]’ );?>

    How to this code “echo do_shortcode(‘[post-views]’);” into smartline_display_postmeta?

    Moderator bcworkz

    (@bcworkz)

    smartline_display_postmeta() is a “pluggable” function, meaning you can create your own version in a child theme and it will be used in place of the default version. You should create a child theme to contain any alterations you make to the theme anyway, otherwise your changes will be lost when the theme is updated.

    Copy the function declaration (in /inc/template-tags.php), including the if ( ! function_exists //... line and the corresponding endif; below, into your child’s functions.php. Insert your echo do_shortcode line where you want the output to appear.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add plugin shortcut into display_postmeta’ is closed to new replies.