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 » Center area post/pages » Post-Kicker, -Byline & -Footer »

[SOLVED] Display only one category in front page posts


  #1  
Old Dec 19, 2009, 09:16 AM
majofa
 
13 posts · Jul 2009
I am trying to display posts of only one category in the front page.

I tried
<?php if (is_front_page()) query_posts('cat=8'); ?>
that I thought was the logic solution, but did not work.

Suggestions ?
  #2  
Old Dec 22, 2009, 04:05 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I'll assume that you are putting using this at ATO->Style & edit CENTER COLUMN->The LOOP
you should try this. Insert as the first line
HTML Code:
<?php if ((is_front_page() and is_category('8')) or (!is_front_page()) { ?>
and add to the last line in The LOOP
HTML Code:
<?php } ?>
As the LOOP is processed, this will say is this the front page, and is this a cat 8? if so process the loop, otherwise if this is NOT the front page, proceed.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Dec 22, 2009, 06:47 PM
majofa
 
13 posts · Jul 2009
Juggledad, I tried as you instructed, but I ended up with no posts displayed at all.

I tried several other categories like "Category 10" or "Category 3" and the results were the same.
  #4  
Old Dec 23, 2009, 05:23 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Two things,
1) do posts show up on other pages?
2) what is the maximum number of posts that will show up on a page?

the answer to (1) will tell me if the logic works.

What I think is happeniong is that you have said 'display X posts ona page' and there are no category '8' posts in the first X posts. The loop is running saying 'Give me the next X posts, THEN this code runs and checks to see if the post is in CAT 8, if not it discards it and goes oin to the next.

So say you will display 10 posts per page and none of the first 10 ae in cat 8, nothing will display, if 2 are in cat 8, then 2 should display, if 4, then 4 will display, etc etc.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Dec 23, 2009, 02:14 PM
majofa
 
13 posts · Jul 2009
1) No posts show up on other pages.

2) The maximum number of posts is set to 4. Category 8 has 141 posts.

We are still in the process of building this site.
You can see the problem at http://ligadeascenso.com/2009/
And you can see how it should look at http://ix.ligadeascenso.com displaying posts of all categories.

Last edited by majofa; Dec 23, 2009 at 05:21 PM.
  #6  
Old Dec 24, 2009, 05:26 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
oops, the IS_CATEGORY should be IN_Category so this is the first line
HTML Code:
<?php if ((is_front_page() and in_category('8')) or (!is_front_page()) { ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Dec 24, 2009, 08:20 AM
majofa
 
13 posts · Jul 2009
Didn't work
  #8  
Old Dec 24, 2009, 08:35 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Try the Frontpage Manager plugin.

Last edited by paulae; Dec 24, 2009 at 08:40 AM.
  #9  
Old Dec 24, 2009, 01:36 PM
majofa
 
13 posts · Jul 2009
Thanks so much Paulae.
The Frontpage Manager Plugin solved completely this problem and a couple of other issues.

And also thanks to you Juggledad.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display posts alphabetically for one category, chronologically for other categories spencer Atahualpa 3 Wordpress theme 4 Jul 16, 2014 09:01 AM
[How To] modify 'Category Page' aka page2cat to display posts instead of just titles juggledad Plugins & Atahualpa 37 Jun 25, 2010 09:03 AM
Making separate pages to display posts by category; also, how to embed WP page Eric Bobrow Atahualpa 3 Wordpress theme 1 Dec 2, 2009 12:34 AM
how to horizontally display the Category Posts Widget ? bryan85 Plugins & Atahualpa 0 Sep 6, 2009 06:28 PM
[SOLVED] Need static header image to display on the front page but no image on any o joaodagraca Header configuration & styling 2 Aug 10, 2009 01:45 AM


All times are GMT -6. The time now is 06:15 AM.


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