Support » Fixing WordPress » centering last visit comment in header

  • I am using some code to try and center the comment in my header that says “0 new posts and 3 new comments since your last visit” and the like. I got some directions a long time ago from Beel how to do this but somehow I’m messing it up again.
    Here’s the code I’m trying to use in the index php file. But I’m probably arranging it wrong:
    < p id = “last_visit” > <?php $wplastvisit_output = “javascript”; require(‘wp-content/plugins/wp-last-visit.php’); ?> < /p >
    Here’s the code I’ve been placing in my wp-layoutl.css file.
    #last_visit {
    It’s quite possible I could be placing that incorrectly as well. Sorry to be such a newbie with coding.

Viewing 7 replies - 1 through 7 (of 7 total)
  • In the CSS that would need to be p #last_visit I would think.

    Mark (podz)


    Support Maven

    Nowhere specific for this, no.
    Does this not work ?
    In the css
    .cent {
    text-align: center;
    In index.php
    <div class="cent">< last visit code ></div>

    Oh yes. There has been a misfire. In the head section you have the p id etc which you shouldnt do. Putting aside the aligning issue this is not quite installed properly. The javascript function should be defined in the head but the function which calls it and the p containing the output should both be where you want it to be in the body. Just read thru the syntax again and you will be fine.

    I’ve tried that out — also putting the code for the index.php in a variety of different places. Doesn’t seem to take any effect. Back awhile ago when I tried to install this plugin, I think I managed to get this centered but no matter what I’m trying I can’t seem to replicate what I had accomplished previously.

    No CSS styling is going to take effect unless the p id is in the body. Not the head.

    Just read your reply Root. Thanks… I’m going to give it a try.

    That did it Root. Thanks for your help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘centering last visit comment in header’ is closed to new replies.