Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Post Navigations on a custome template


  #1  
Old May 9, 2010, 03:56 PM
mrfroasty
 
8 posts · Jul 2009
Hello,
I am trying to use a template for a page that will display one specific category.
So I have followed the advice in previous reading here and out here as well.Copy paste index.php to something.php, and put a query to that category.Basically this is pure index.php with only 1 extra line.

But unfortunately, I see that the navigation of "next/previous" works well on single post. But "new entries" && "old entries" it always point to the same page of the template.I have been trying to resolve the issue with not much progress.Could you please advise on this one...thanks.

This doesnt happen on a default theme though

Here is my complete template:
PHP Code:
<?php
/**
 * Template Name: Matangazo Page Template
 */
?>
<?php
/* get all options: */
include (TEMPLATEPATH '/functions/bfa_get_options.php');
get_header(); ?>

<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] == 0/* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

    <?php /* This outputs the next/previous post or page navigation.
    This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
    
bfa_center_content($bfa_ata['content_above_loop']); ?>
        
        <?php   query_posts('category_name=Matangazo'); ?>
    <?php /* The LOOP starts here. Do this for all posts: */
    
while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>

                <?php if ( !(in_category('Matangazo')) || !is_home() ) { ?>


        <?php /* Add Odd or Even post class so post containers can get alternating CSS style (optional) */
        
$odd_or_even = (($bfa_ata['postcount'] % 2) ? 'odd-post' 'even-post' ); ?>

        <?php /* This is the actual Wordpress LOOP.
        The output can be edited at Atahualpa Theme Options -> Style & edit the Center column */
        
bfa_center_content($bfa_ata['content_inside_loop']); ?>

                <?php /*ends the matangazo if*/?>


    <?php /* END of the LOOP */
    
endwhile; ?>

    <?php /* This outputs the next/previous post or page navigation and the comment template.
    This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
    
bfa_center_content($bfa_ata['content_below_loop']); ?>

<?php /* END of: If there are any posts */
else : /* If there are no posts: */ ?>

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>

<?php endif; /* END of: If there are no posts */ ?>

<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>
The link to our blog where we are using this template is here:http://www.mzalendo.net/matangazo
  #2  
Old May 9, 2010, 07:58 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Your problem is the <?php query_posts('category_name=Matangazo'); ?> is outside the loop, so it resets the query to start over every time.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old May 10, 2010, 02:33 PM
mrfroasty
 
8 posts · Jul 2009
Thanks juggledad, but unfortunately if you put this line inside of the loop, then its a "forever" loop.I mean a loop that is always true and it never ends.
PHP Code:
        <?php   query_posts('category_name=Matangazo'); ?>
  #4  
Old May 10, 2010, 03:52 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
What you are doing is coding your own loop. in doing this you need to keep a count of where you are so you can restart at that location, You need to do a little research about how to code your own loop (check out the documentation at wordpress.org) In effect, you are coding your own plugin
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old May 11, 2010, 01:05 AM
mrfroasty
 
8 posts · Jul 2009
Thanks, but b4 i posted this was the advice from this forum.Copy paste index.php and add that line outside of the loop.

That is exactly what I did but its having 1 little thing that is not working correct i.e naviagation of the pages,but nearly 85% it does what I wanted to display a category of post in a page.I will re-write the whole template this weekend, and report back on my findings.

cheers.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with adding a pic to custom post template in center area frankhamm Center area post/pages 2 Mar 15, 2010 07:38 AM
Post Template ThaddeusB1 Center area post/pages 0 Jan 5, 2010 01:05 PM
google custome search code saifullahraza Plugins & Atahualpa 1 Sep 17, 2009 02:11 PM
How to turn off Atahualpa Post Options, interferes (kind of) with Post Template maccool Post-Kicker, -Byline & -Footer 1 Aug 13, 2009 10:00 AM
Creating custom post template paulae Atahualpa 3 Wordpress theme 3 Mar 18, 2009 11:36 AM


All times are GMT -6. The time now is 09:34 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.