WordPress.org

Ready to get started?Download WordPress

Forums

Active state based on post (3 posts)

  1. illusiv
    Member
    Posted 5 years ago #

    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,
    Melvin

  2. illusiv
    Member
    Posted 5 years ago #

    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!

  3. illusiv
    Member
    Posted 5 years ago #

    anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic