• Hey Guys,

    Having some trouble getting thing to work with the loop

    Here is the code I’m using. I would like

    <div id="main_ss">
    <?php if ( function_exists('show_nivo_slider') ) {show_nivo_slider(); } ?>
    </div>

    to work before the content loop because it is a sideshow for the top of the page.

    ?php if (have_posts()) : while (have_posts()) : the_post();?>
    
                            <div class="entry">
    
                                <?php the_content(); ?>
    
                            </div>
    
                        <?php endwhile; endif; ?>
                        <div id="main_ss">
                        <?php if ( function_exists('show_nivo_slider') ) { show_nivo_slider(); } ?>
                        </div>
Viewing 15 replies - 1 through 15 (of 18 total)
  • What happens if you just move the code ahead of the loop, like this:

    <div id="main_ss">
    <?php if ( function_exists('show_nivo_slider') ) { show_nivo_slider(); } ?>
    </div>
    <?php if (have_posts()) : while (have_posts()) : the_post();?>
    
       <div class="entry">
    
          <?php the_content(); ?>
    
       </div>
    
    <?php endwhile; endif; ?>
    Thread Starter nicho

    (@nicho)

    Hi vtxyzzy, when I put it ahead of the loop it breaks the bottom part of the page and the bottom content does not display.

    In that case, the slider may have an unclosed div or other unbalanced tag. Can you post a link to the site where it is working below the loop?

    Thread Starter nicho

    (@nicho)

    I’m actually working on it locally on a local server setup on my machine.

    I can post the code for either the whole page or just the plugin or both. Let me know what would be best.

    Actually, neither will help very much. I was going to bring up the page in Firebug to look at the generated html.

    Thread Starter nicho

    (@nicho)

    Ok… It’s gonna take a bit but I’ll try to get it online soon and I’ll let you know.

    Thread Starter nicho

    (@nicho)

    vtxyzzy, Had an unused copy of WordPress on my online server… Here the address for the page – https://brain2brand.com/ramosbluepits.com/

    OK – I guess I need to know what you are trying to accomplish by moving the code. The position of the output is fixed as absolute in the css, so moving the code will not change the position of the images.

    Thread Starter nicho

    (@nicho)

    I did the absolute positioning as a last resort because the code wouldn’t work above the loop. I haven’t browser tested it yet to see if it worked across the board. I just wanted to fix it where I could put the code where I actually need it and it would work.

    Alright, please post the code for the template in the pastebin and the link to it back here.

    Thread Starter nicho

    (@nicho)

    Okay, here is the link it gave me for the pste – https://pastebin.com/f7Rphwtj

    Thread Starter nicho

    (@nicho)

    vtxzzy, the pastebin does not seem to do anything. It send me a link but there is nothing within the page….

    Did you paste in your code? I just tried a test and it worked:
    https://wordpress.pastebin.com/MhyTvPuA

    This expires in 10 mins.

    Thread Starter nicho

    (@nicho)

    Here you go, I needed to use the firefox plugin for it to work – https://pastebin.com/ZLaAft6T

    OK – please try this. Move the lines of code for the slider just above the second </div> before the if test that starts the loop:

    <!-- put code under this line -->
             <div id="main_ss">
                <?php if ( function_exists('show_nivo_slider') ) { show_nivo_slider(); } ?>
             </div>
    
          </div>
    
       </div>
    
       <?php if (have_posts()) : while (have_posts()) : the_post();?>
Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Having trouple with WordPress loop…’ is closed to new replies.