batflash
Member
Posted 4 months ago #
I am looking for a way to display posts in category "xyz" on the front/home page of my site, while also displaying ALL posts (including those posts in category "xyz") on a second page of my site.
I tried the List Categories Post plugin after reading about it in the forum, but I could only get it to display a list of post names (as hyperlinks) in a category and not the actual posts with excerpts and images as they appear on the current home page, so I am not sure if that plugin is what I need.
Can anyone help me?
Thank you.
I think you can do what you want with the WP Menus and the Page Links To plugin.
- Install and activate the plugin.
- Create a new blank Page for the front page.
- In the Page Links To URL, put a url like http://mysite.com/?category_name=xyz
- Publish the page.
- Create another blank Page for all categories and Publish it.
- Go to Admin->Settings->Reading and click 'Front page displays - A static page' and choose the name of your front Page in the dropdown.
- Select the name of the other page as the Posts page.
- Create a menu with these two pages and any other menu items you want.
If you need help with the menu, here is a good tutorial:
http://ericasays.com/2984/wordpress-3-custom-menu-tutorial/
batflash
Member
Posted 4 months ago #
Thank you for your reply.
This almost worked.
The posts displayed, but the "is_front_page()" code I have for displaying a slideshow on only the front page of the site would not work, since the new "front page" was actually linking to the xyz page.
So, I am still looking for a solution.
Thanks again!
Try changing 'is_front_page()' to 'is_page("xyz")'
batflash
Member
Posted 4 months ago #
"page links to" goes to: http://mysite.com/?category_name=xyz
the "is_page" code now says: 'is_page("xyz")'
But the page and category must not be lining up.
Any suggestions?
Sorry, you need to replace 'xyz' with the slug of your page.
batflash
Member
Posted 4 months ago #
Where do I need to change this?
I changed 'xyz' in the "page links to" to the slugname. This did not show my custom slideshow.
Then I changed 'xyz' in the header.php file (is_page("slugname")) and this did not show my custom slideshow.
Thanks again for your help.
Did you replace 'mysite.com' with your site name?
batflash
Member
Posted 4 months ago #
I did.
The front page is set to display a static page ("xyz").
The xyz page "page links to" field points to http://www.thesitename.com/?category_name=xyz
The line for the custom slideshow in the header.php file is set to:
if (is_page("xyz"))
I tried replacing "xyz" with the slugname, first in the "page links to" field and then in the header.php file. Both changes were unsuccessful, so I have changed them back.
I'm sorry, the 'xyz' needs to be the actual slug for the category, not the page name. It needs to be the actual slug in both places.
It really doesn't matter what you name the page as long as it is set to be the static front page.
batflash
Member
Posted 4 months ago #
Ok.
If the slug for the category I want is xyz, what does the "page links to" field on the front page edit need to be?
Then, will is_page() need to be is_page("front-page-name") now instead of is_page("xyz")?
batflash
Member
Posted 4 months ago #
I think we have it.
I set the front page to display a page I created called "Frontpage".
I set the slug name of the category I want to display on "Frontpage" to xyz
On the "Frontpage" edit screen, I set the "Page Links To" field to http://www.thesitename.com/?category_name=xyz
To display the custom slideshow, I changed the line in the header file... I used is_category('xyz') (instead of is_page("xyz")).
Thank you very much for helping me out! :)