ThemeShaper Forums » Thematic

[closed]

thematic category loop in a new page template layout problem

(2 posts)
  • Started 4 years ago by pelayo.mao
  • Latest reply from pelayo.mao
  • This topic is resolved
  1. pelayo.mao
    Member

    I´m trying to make a page that shows a little introduction and the last three posts of one category. I managed to make a custom php template (rrpp.php) and the posts show but the div position is a mess...

    I have three objetives:

    - Make the layout look ok.
    - I want the posts showing images (the best would be a thumbnail) how?
    - Id like to make the titles of those posts smaller. how?

    The code Ive done for the page template is this:

    <?php
    /*
    Template Name: Relaciones Publicas
    */
    ?>
    <?php
    
        // calling the header.php
        get_header();
    
        // action hook for placing content above #container
        thematic_abovecontainer();
    
    ?>
    
    	<div id="container">
    		<div id="content">
    
                <?php
    
                // calling the widget area 'page-top'
                get_sidebar('page-top');
    
                the_post();
    
                ?>
    
    			<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class() ?>">
    
                    <?php 
    
                    // creating the post header
                    thematic_postheader();
    
                    ?>
    
    				<div class="entry-content">
    
                        <?php
    
                        the_content();
    
                        edit_post_link(__('Edit', 'thematic'),'<span class="edit-link">','</span>') ?>
    
    				</div>
    			</div><!-- .post -->
    <?php // Get the last 3 posts in the featured category.?>
      <?php query_posts('category_name=relaciones-publicas&showposts=3'); ?>
      <?php $my_query = new WP_Query('category_name=relaciones-publicas&showposts=3'); ?>
    
      <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
                <div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class(); ?>">
        			<?php thematic_postheader(); ?>
    				<div class="entry-content"> 
    
                                          <?php thematic_content(); ?>
    
                                           <?php $ids[]= $post->ID; endwhile;?>
    
    					<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
    				</div>
    			<?php thematic_postfooter(); ?>
    
            <?php
    
            if ( get_post_custom_values('comments') )
                thematic_comments_template(); // Add a key/value of "comments" to enable comments on pages!
    
            // calling the widget area 'page-bottom'
            get_sidebar('page-bottom');
    
            ?>
    
    		</div><!-- #content -->
    	</div><!-- #container -->
    
    <?php 
    
        // action hook for placing content below #container
        thematic_belowcontainer();
    
        // calling the standard sidebar
        thematic_sidebar();
    
        // calling footer.php
        get_footer();
    
    ?>

    The page template is http://www.cartom.com/wp/?page_id=127 (I cannot change url to beautiful ones, it doesnt work...)

    ¿Why the layout mess?

    Thankyou

    Posted 4 years ago #
  2. pelayo.mao
    Member

    Ok, there was two divs without </div> tag.
    Here is the correct code for a page template that shows page content and 3 posts of one category:

    <?php
    /*
    Template Name: EnterTheTemplateName
    */
    ?>
    <?php
    
    <?php
    
        // calling the header.php
        get_header();
    
        // action hook for placing content above #container
        thematic_abovecontainer();
    
    ?>
    
    	<div id="container">
    		<div id="content">
    
                <?php
    
                // calling the widget area 'page-top'
                get_sidebar('page-top');
    
                the_post();
    
                ?>
    
    			<div id="post-<?php the_ID(); ?>" class="<?php thematic_post_class() ?>">
    
                    <?php 
    
                    // creating the post header
                    thematic_postheader();
    
                    ?>
    
    				<div class="entry-content">
    
                        <?php
    
                        the_content();
    
                        wp_link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'thematic'), "</div>\n", 'number');
    
                        edit_post_link(__('Edit', 'thematic'),'<span class="edit-link">','</span>') ?>
    
    				</div></div><!-- .post -->
    
    <?php // Get the last 3 posts in the featured category.?>
      <?php query_posts('category_name=enteryourcategory&showposts=3'); ?>
      <?php $my_query = new WP_Query('category_name=enteryourcategory&showposts=3'); ?>
    
      <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
    
        			<?php thematic_postheader(); ?>
    				<div class="entry-content"> 
    
                                          <?php thematic_content(); ?>
    
                                           <?php $ids[]= $post->ID; endwhile;?>
    
    					<?php wp_link_pages('before=<div class="page-link">' .__('Pages:', 'thematic') . '&after=</div>') ?>
    				</div>
    			<?php thematic_postfooter(); ?>
    
            <?php
    
            if ( get_post_custom_values('comments') )
                thematic_comments_template(); // Add a key/value of "comments" to enable comments on pages!
    
            // calling the widget area 'page-bottom'
            get_sidebar('page-bottom');
    
            ?>
    </div></div>
    		</div><!-- #content -->
    	</div><!-- #container -->
    
    <?php 
    
        // action hook for placing content below #container
        thematic_belowcontainer();
    
        // calling the standard sidebar
        thematic_sidebar();
    
        // calling footer.php
        get_footer();
    
    ?>

    ¿How can I change the format of the post titles only in this page and make it to show thumbnails of each post?

    Posted 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.