Support » How-To and Troubleshooting » Call pages instead pages

Call pages instead pages

  • pedroooo


    Hi folks,

    Can anyone tell me how i call pages instead from posts? I have this code in my wordpress.
    Any expert?

    <div id="accordian" ><!--Parent of the Accordion-->
    <?php $i = 3; if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!--Start of each accordion item-->
      <div id="test<?php if ($i != 1) { echo $i-1; } ?>-header" class="accordion_headings<?php if ($i == 1)  ?>" ><?php the_title(); ?></div><!--Heading of the accordion ( clicked to show n hide ) -->
      <!--Prefix of heading (the DIV above this) and content (the DIV below this) to be same... eg. foo-header & foo-content-->
      <div id="test<?php if ($i != 1) { echo $i-1; } ?>-content"><!--DIV which show/hide on click of header-->
          <!--This DIV is for inline styling like padding...-->
        <div class="accordion_child">
            <?php the_content(''); ?>
Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi


    Forum Moderator




    i dont understand what i have to change in the script.

    Can you light me up?



    Done. Resolve what i ask.
    But know i have another problem. i can’t put posts in a page like a page with “News”.

    I still want use the posts..

    If anybody’s wondering, here’s the fix:

    query_posts( array( 'post_type' => array('page', 'movie') ) );

    Add that before this:

    <?php $i = 3; if (have_posts()) : while (have_posts()) : the_post(); ?>

    Full Example:

    <?php query_posts( array( 'post_type' => array('page', 'movie') ) ); $i = 1; if (have_posts()) : while (have_posts()) : the_post(); ?>

    It worked out great!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Call pages instead pages’ is closed to new replies.