[Resolved] Place counter php code before date and post autor in single.php?

Home Forums Support [Resolved] Place counter php code before date and post autor in single.php?

Home Forums Support Place counter php code before date and post autor in single.php?

  • This topic has 6 replies, 2 voices, and was last updated 4 years ago by David.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1245189
    NIKOLAY

    Hello,

    I’m trying to place php code which count each reload of each post in my web site.

    In my old theme I place the php code just before publish date and post autor (after tilte in single.php file of theme).

    The php code is: <?php echo_views(get_the_ID()); ?>

    I’m tring to use hook for single post after tiltle and it is work well.

    Is it possible to place on same row as date and autor instead before them after title?

    Regards: Nick

    #1245195
    David
    Staff
    Customer Support

    Hi there

    can you link me to a post where i can see this ? Maybe a simple CSS fix.

    #1245203
    NIKOLAY
    #1245244
    David
    Staff
    Customer Support

    Could you wrap your function in a DIV like so:

    <div class="post-views"><?php echo_views(get_the_ID()); ?></div>

    Then add this CSS:

    .single .entry-meta, .post-views {
        display: inline-block;
        margin-right: 1em;
    }
    .post-views font {
        font-size: 85% !important;
    }
    #1245283
    NIKOLAY

    It is stay still bellow data and post autor

    #1245706
    NIKOLAY

    I did all in one line with hook -> counter php + date + category and did not use theme date and author…

    Thanks for your help

    #1246164
    David
    Staff
    Customer Support

    Glad to hear you found a solution

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.