WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to display content inline within a template? (7 posts)

  1. gaznev2000
    Member
    Posted 1 year ago #

    Hi all, currently working on this page.http://www.macsmagazine.com/health-living/horoscopes/.
    However, I can't figure out how to get the accordion at the bottom to display inline, so that the footer responds to the accordion movement. I think it has something to do with nested loops but i'm not 100% sure. I am currently just using css to move the content container down, but i know this isn't right. Also the accordion is only working sporadically and i'm not sure as to why, think its the lay out though.

    Hope you can help.

    My code is below:

    [That's too much code for here and without the code buttons it may have been corrupted anyway. Please see:
    http://codex.wordpress.org/Forum_Welcome#Posting_Code - use a pastebin to post code; ]

  2. paulwpxp
    Font hero
    Posted 1 year ago #

    The markup is messed up.

    Right now the accordion section is put inside the roundabout slider, you have to take the whole accordion section out on its own.

  3. gaznev2000
    Member
    Posted 1 year ago #

    Thanks for the reply. so i should put in into its own loop?

  4. paulwpxp
    Font hero
    Posted 1 year ago #

    It doesn't matter how you query up the contents, the bottom line is these 2 sections must be seperated, they can't be inside the same html element.

    Considering the type of content, and how the content will be displayed, yes you should craft up different loop. The slider and the lists in accordion don't mix, it's entirely differnt thing.

  5. gaznev2000
    Member
    Posted 1 year ago #

    Thanks so much Paul. I'm am just doing a loop now. However, it isn't displaying the content of the page, instead it's displaying the full content of a previously stated category. Do i need to add a end previous loop function or something.

    Code

  6. paulwpxp
    Font hero
    Posted 1 year ago #

    You only have 1 loop there, and what you did there is altering the main loop. It's doable, if done right, but is not a recommended method for a special template that requires multiple sections like this.

    In short, don't use query_posts, use WP_Query method instead.
    http://codex.wordpress.org/Class_Reference/WP_Query

  7. gaznev2000
    Member
    Posted 1 year ago #

    Thanks for your help Paul. I managed to do it with

    <?php $query = new WP_Query( 'cat=3339' );; while($query->have_posts()) : $query->the_post();?>
           <?php the_content(); ?>
    <?php endwhile; ?>

    I also tried the post ID method but it didn't work, thus I had to create a new cat and assign the post to it.

    Thank for your time.
    Gary

Topic Closed

This topic has been closed to new replies.

About this Topic