|
#1
Feb 24, 2009, 03:37 PM
|
|
I need to be able to make posts and not have them appear on the main page. How can I do this?
I'm using the main page as a blog that will have post daily.
I need to be able to post to the secondary page and not have it show up on the first page.
What is the best way to set this up? Do I need a PlugIn?
I tried Page2Cat but it just bullet point lists Category Titles.
|
#2
Feb 24, 2009, 04:19 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
To have posts of a certain category not show up on the home page, find, in index.php, around line 100-103, this:
PHP Code:
<?php // Do this for all posts: while (have_posts()) : the_post(); $postcount++; ?>
(You might not have the $postcount++ part if your Atahualpa version is older)
and add the following right above it (to exclude posts of the category with the ID 3):
PHP Code:
<?php if ( is_home() AND !is_paged() ) { query_posts($query_string . "&cat=-3"); } ?>
To exclude posts from several categories, i.e. categories with the ID's 3, 7 and 11:
PHP Code:
<?php if ( is_home() AND !is_paged() ) { query_posts($query_string . "&cat=-3,-7,-11"); } ?>
|
#3
Feb 24, 2009, 04:48 PM
|
|
I do have that code. It's around line 41 though.
I was hoping that I could create a custom field or do something else. I would like to avoid having to update my index.php every time I post to the secondary page.
Any other Ideas or suggestions?
|
#4
Feb 24, 2009, 05:07 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Why would you have to update your index.php each time? If you want a new post to not appear on the homepage, put it into the category that you excluded with the above code.
|
#5
Feb 24, 2009, 05:21 PM
|
|
I don't know what I was thinking, you're right.
|
#6
Feb 25, 2009, 06:54 AM
|
|
The code works, the new posts are now only posting to the Category I want them to.
Is it possible to not have those posts show up in the "Recent Post" widget?
Also the posts to the Categories show up in a "Collapsed" state, not showing the content in the body, only the Title. Any idea about this?
|
#7
Feb 25, 2009, 07:02 AM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Quote:
Originally Posted by TPR
The code works, the new posts are now only posting to the Category I want them to.
Is it possible to not have those posts show up in the "Recent Post" widget?
|
Probably with another widget, something that offers more options. See http://wordpress.org/extend/plugins/
Quote:
Originally Posted by TPR
Also the posts to the Categories show up in a "Collapsed" state, not showing the content in the body, only the Title. Any idea about this?
|
Only the title, or the title and a part of the body? Are you using the Read more tag in those posts? That would require another code
|
#8
Feb 25, 2009, 03:21 PM
|
|
Quote:
Only the title, or the title and a part of the body? Are you using the Read more tag
|
After looking at it a little closer. It will show the Text in the body, but not the images/media in the body. When the Post Title is clicked the body will expand and show the image/media.
No, I'm not using the more tag.
I can't find something to work that doesn't through off the design of the site. All That I need is the widget to not display comments from a couple categories.
|
#9
Apr 2, 2009, 10:07 AM
|
|
Quote:
Originally Posted by Flynn
To have posts of a certain category not show up on the home page, find, in index.php, around line 100-103, this:
PHP Code:
<?php // Do this for all posts:
while (have_posts()) : the_post(); $postcount++; ?>
(You might not have the $postcount++ part if your Atahualpa version is older)
and add the following right above it (to exclude posts of the category with the ID 3):
PHP Code:
<?php if ( is_home() AND !is_paged() ) {
query_posts($query_string . "&cat=-3");
} ?>
To exclude posts from several categories, i.e. categories with the ID's 3, 7 and 11:
PHP Code:
<?php if ( is_home() AND !is_paged() ) {
query_posts($query_string . "&cat=-3,-7,-11");
} ?>
|
Hello,
I found this post very helpful, however I tried it on my website: www.gametvweb.com didn't work, Actually the instruction
<?php // Do this for all posts:
while (have_posts()) : the_post(); $postcount++; ?> was in page.php file not the in index.php. I dont want to havefeatred articles to be posted on the main page, do u have any clew how to do it.
any help will be much appreciated.
thanks
|
#10
Apr 2, 2009, 09:32 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
You shouldn't have a page.php. What Atahualpa version do you have?
|
#11
Apr 3, 2009, 01:35 AM
|
|
Sorry I don't know what is Atahualpa ? how can I know which version is? the only think I know is I'm using wordpress 2.7.1 !!!
But definitely the them has page.php file, I included the them file on this link http://www.gametvweb.com/theme/ please take a look at them and let me know what do u think?
Your help really appreciated.
Thanks
|
#12
Apr 3, 2009, 07:47 PM
|
|
|
|
3,768 posts · Oct 2008
Munich, Germany
|
|
Quote:
Originally Posted by Nad
Sorry I don't know what is Atahualpa ? how can I know which version is? the only think I know is I'm using wordpress 2.7.1 !!!
But definitely the them has page.php file, I included the them file on this link http://www.gametvweb.com/theme/ please take a look at them and let me know what do u think?
Your help really appreciated.
Thanks
|
You seem to be using another theme. I cannot support other developer's themes I'm afraid. I suggest that you ask on the blog of the developer of your theme.
|
#13
Apr 4, 2009, 02:20 AM
|
|
Sorry I didn't know that , but thanks for your time anyway
|
#14
May 20, 2009, 06:35 AM
|
|
Thank to everyone for the explanations.
Reading you guys talk through these issues really helps a beginner like myself :D
|
#15
Jul 29, 2010, 08:23 AM
|
|
Hi Flynn, I was wondering if we could backtrack to a part of post #1
Quote:
I need to be able to post to the secondary page and not have it show up on the first page.
|
NOT having a post turn up has been dealt with, but what about getting it to turn up on the 2ndry page?
How to post a certain category, in this case "news" category posts, to a page called NEWS, whilst any other posts will go to HOME page? I have page2cat plugin, but that doesn't seem to work even though I have filled in all the bits that need to be filled in and linked it all together.
Any ideas?
|
#16
Jul 29, 2010, 09:13 AM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
I put together a 'HOWTO: a 'Custom Query' PAGE template' thread with a template to allow you to make custom queries because page2cat didn't work for me. see
http://forum.bytesforall.com/showthread.php?t=7822
it is in the gold forum
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
#18
Aug 4, 2010, 05:32 PM
|
|
Hi Juggledad,
i have donated as instructed and still can't get in to your thread. I have also written to Flynn to mention this to him (it says to PM him at the top of this forum if you make a donation). Is it up to Flynn or you to credit this donation? Please PM me if you need the email address I used.
|
#19
Aug 4, 2010, 08:24 PM
|
|
|
|
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
|
|
Send me a PM with a copy of the pay pal confirmation and I'll look into it
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
|