• Jessi

    (@wbjtk)


    For each of my blog posts, I am trying to click a link that opens the post’s content in the lightbox. Seems when I click the link, for all three blogs it displays only the first blog post’s content on each one. Is there a way I can adjust this?

    <a class="lbp-inline-link-1" href="#">Lyrics</a>
    <div style="display: none;">
    <div id="lbp-inline-href-1" style="padding: 10px; background: #fff;">
    
    <?php the_content(); ?>
    
    </div>
    </div>

    http://ww.wp.xz.cn/extend/plugins/lightbox-plus/

Viewing 7 replies - 1 through 7 (of 7 total)
  • geblord

    (@geblord)

    try replacing the numbers in your loop with <?php the_ID(); ?>

    But doing this you will need to estimate how many inline lightboxes you will need, and doing so will probably create a bunch of unnecessary, and unused code. If there is a better solution I would like to know it!

    <a href="#">Lyrics</a>
    <div style="display: none;">
    <div id="lbp-inline-href-<?php the_ID(); ?>" style="padding: 10px; background: #fff;">
    
    <?php the_content(); ?>
    
    </div>
    </div>

    Thread Starter Jessi

    (@wbjtk)

    Thanks for the reply!
    That didn’t work though 🙁
    I guess because we need some code to automatically generate a 1, 2 and 3 in that spot

    I am only showing 3 blog posts, so I would need it to somehow do that automatically. It has to be one of those augmented php scripts that is over my head.

    Still hoping to find an answer!

    geblord

    (@geblord)

    what did it generate?

    Mine generates the post ID and then it just links up with the inline ID. this is my full code: Depending where your using your php it may not work the same as mine.

    <?php query_posts(array('paged' => get_query_var('page'),'posts_per_page' => 25, 'cat'      => 3,) ); ?>
    <?php while ( have_posts() ) : the_post(); ?>
    <li>
    <a href="#" class="lbp-inline-link-<?php the_ID(); ?>" >
    <?php the_post_thumbnail('full'); ?>
    <div>
    </div>
    </a>
    <div style="display: none;">
    <div id="lbp-inline-href-<?php the_ID(); ?>" style="padding:10px;">
    <?php the_content(); ?>
    </div>
    </div>
    </li>
    <?php endwhile; wp_reset_query(); ?>
    Thread Starter Jessi

    (@wbjtk)

    See I think the problem is, you have to set the number of inline lightboxes. The max is 100. So I set it to 100 and noticed that my post id is 403. So that won’t work right? if my post id was say 28, it would implement inline lightbox #28 that I have set?
    Does this make sense? It is possible it may work for others. Is there a way for me to fix it still?

    Thread Starter Jessi

    (@wbjtk)

    ok i just noticed you can set it to 1000 as the max number of inline lightboxes.

    does yours work geblord? i am still getting the same content for all boxes, from post 1. i can’t get it to show each post’s content.

    any clue what i’m missing??
    thanks for your help!

    geblord

    (@geblord)

    If you are really desperate maybe use a plugin( http://ww.wp.xz.cn/plugins/reveal-ids-for-wp-admin-25/ ) to reveal the post id and then just rename the inline light boxes to your corresponding post IDs.

    So for #inline-lightbox-1 you could just change your lbp-inline-link- and lbp-inline-href- to the number that matches your post ID. Not very efficient but could possibly work. that would be using my php id code.

    Thread Starter Jessi

    (@wbjtk)

    that would possibly work, but wouldn’t be automatic so it would be no good for my use. but thanks for the tip

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘adding the_content to inline lightbox’ is closed to new replies.