• Ive installed “lightbox plus colorbox” plugin and im trying to call the latest post from the CPT notices. the notices have post expiration so essentially im looking to display the latest alert on the homepage.

    What ive’e learned from google so far:

    <?php
            $hotfoodpresent = get_posts( array('post_type' => 'st_notice', 'posts_per_page' => -1) );
            if($hotfoodpresent) echo '<a class="lbp-inline-link-1 cboxElement" href="#"></a>
    <div style="display: none;">
    <div id="lbp-inline-href-1" style="padding:10px; background: #fff;">
    
    <?php if (have_posts()):
        while (have_posts()):
            the_post();
            wp_redirect(get_permalink());
        endwhile;
    endif; ?>
    
    </div>
    </div>';
        ?>

    But I think im going about this the wrong way as I don’t see anything in the pop-up.

    I would not like to use plugins as this wordpress installation will remain on a local network without internet access.

    Thankyou in advance for the help if you can!

  • The topic ‘post in a lightbox?’ is closed to new replies.