• I am trying to build my own theme.
    So far so good, I am just down two a couple of things that I cant seem to figure out.
    Bellow is the code I am using to show a list of posts. I have two categories. When I put a 0 on ‘category’ it will show all posts. When I put a 1 it shows only 1 category. But no matter what I try I cant get the second category to show by it self. Any ideas?

    [code moderated – please use the pastebin]

    The second issue is that I would like show page previews on my index page under 4 different locations. Looking for the correct code to do a specific page title and except.

    Thank you for your time

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter mexxa84

    (@mexxa84)

    I think I just solved the first problem.
    I changed categories to categories_name and that did it.

    Still looking for a solution to preview pages in different areas of the main page.

    Thank you.

    Thread Starter mexxa84

    (@mexxa84)

    SO I found this way of listing the pages:

    <?php
    	  $tamal=array(
    	  'post_type' =>'page',
    	   );
    	   $page_query = new WP_Query($tamal); ?>
    	<?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
    	<h4><?php the_title();?></h4>
    	<div id="c_col1"><a href="integration"><span class="span_link"></span></a></div>
        <p><?php the_excerpt(); ?></p>
    	<div class="more_2"><a href="<?php the_permalink(); ?>">[ READ MORE ]</a></div>
    	<?php endwhile; ?>

    The problem is it list all the pages. What do I need to write in the array so that only a specific page shows?

    Thread Starter mexxa84

    (@mexxa84)

    Ok so I found this:
    ‘post__in’ => array(62),

    you can change the 62 to whatever page id you want.

    This is the final code

    <?php
    	  $tamal=array(
    	  'post_type' =>'page',
    	  'post__in' => array(62),
    	   );
    	   $page_query = new WP_Query($tamal); ?>
    	<?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
    	<h4><?php the_title();?></h4>
    	<div id="c_col2"><a href="conferencing"><span class="span_link"></span></a></div>
        <p><?php the_excerpt(); ?></p>
    	<div class="more_2"><a href="<?php the_permalink(); ?>">[ READ MORE ]</a></div>
    	<?php endwhile; ?>

    This works for adding the excerpt of a specific page.
    Should I be doing it some other way or is this pretty much it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom archive theme problem and …’ is closed to new replies.