thematic page display posts - Wordpress Solution
[Solved] - thematic page display posts - Wordpress Solution |
---|
Try following codes |
I am building a wordpress site creating a child theme on thematic. This is the site so far:
http://www.greenfrontiersenergy.com/
I need help with 2 pages, the "people" and "news."
I would like the posts that are in the people category to be displayed on the "people" page and the posts in the press release category to be displayed in the "News" page. I would like the full post to be displayed (not an excerpt) and I dont want the post title to link anywhere.
On the people page, I would like to utilize the thumbnail function to set the profile image.
I do not want the sidebar to appear on the people page.
Attached are jpegs of what I would like the 2 pages to look like.
Please message me if you can work on this for me and let me know what files you need access to.
Thanks
Solution - 1Well, I cannot see your attached images, but I can already tell you that you actually have 2 options. The simplest would be to redirect these pages to their respective categories using either the page-links-to plugin or a page template with a simple http redirect. You can then style the category to appear however you like, thanks to all of the dynamic classes available. Alternatively, if you have a reason for these pages to remain pages while pulling in the post loop, that is totally possible too. Below is the code you need, create a new file named page_category.php (the name is irrelevant) and paste this into it. I'll explain whats hapening after after: The beginning just declares the file as a page template, and the rest is a duplicate of page.php with a little bit inserted into it. This is the part you actually care about, as it is what makes it possible to loop through whatever category/categories you want. Lines 22-34 (below) are basically making a temporary query based on variables you pass via custom fields: This is just a simple wp_query, driven by variables that uses the stock thematic functions to draw in the post content and the prev/next navigation beneath it. The $temp variable stores the existing query so we can call it back later (in case you need it later, for use with page categories, for example). You can see that we restore this at the end of the query process. The $categoryid variable is set within the page editor as a Custom Field of 'categoryid' with the ID of the category you want to display as it's value. The $showposts variable is also a custom field of 'showposts' with the number of posts you want to display (e.g. 5). The $paged variable is necessary for the navigation (prev/next links) to appear and function. To take more control of how the article is displayed you can either filter the thematic_singlepost function, or replace it with the exact article code you'd like to use. To remove the sidebar you can either style it away for the page it should be hidden, or just remove the thematic_sidebar() reference at the end and save it as a separate page template. Hope this is all clear! Solution - 2Here is how I modified the page.php file on thematic to accomplish what you need. NOTE that I have commented the starting and finishing blocks where I edited something. This works on the people page. In my case, my people page is named "PEOPLE" all in capitals. You just need to change that value for the name of your page. For example, to do the same on the news page you would just add another similar block but instead of you would do and then also change the part where it says for something like Please note that this modifies the loop, so you night want to add it when all your page has been processed. I hope this is what you are looking for. NOTE: I'm editing page.php on thematic template directly. themes/thematic/page.php Solution - 3Or you can make the 'page.php' template a little different. If what Brian wrote doesn't work, I'll write you a tutorial how to do so. |
Date: 2022-10-21 05:23:04 |
Category: Wordpress |