Support » Fixing WordPress » Active state based on post

  • Hello,

    Take a look at my site. You can see a scroller in the footer were you can select a post by clicking on it. I’m looking for the following solution:

    After you select a post I want to add a class to a div of the selected post in the scroller to get a active state on it. So you know which post you selected.

    Anyone know how to fix this? I really don’t know were to start…

    Kind Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • I know it’s something like this:

    <?php if ( is_single(???)   ) { ?>
    <div class="Active" id="post-<?php the_ID(); ?>">
    <?php } else { ?>
    <div id="post-<?php the_ID(); ?>">
    <?php } ?>

    But the is_single(???) ID is dynamic. How can I get the ID based on a single post?

    Looking forward to solutions!


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Active state based on post’ is closed to new replies.