- This topic is empty.
-
AuthorPosts
-
November 3, 2009 at 12:18 pm #26646TXChetGMember
I have a site set up to function only on WordPress, but I am having a problem I have never come across before. I have my home page set to be a static page, while my posts are displayed as a portfolio. I also wanted to have the ability to display my posts that are not Portfolio Entries on the home page as an updates section.
After doing some reading through the Codex I decided that get_posts(); would be the most efficient way to do this. After developing and running my PHP and HTML I have run across my issue. Seen here: http://chetgproductions.com.
After the posts are displayed the template tags seem to become confused. Where I use the_title(); it displays the title of the page, not the title of that post, the same thing happens with the date.
Here is the coding I am using:
Code:” id=”post-“>
Posted on
The coding is derived directly from the WP Codex, and it works exactly as it should, except these minor details. If any of you have some insight on how to address this problem please pass along your knowledge. It’s greatly appreciated.
*UPDATE*
I’ve done some more reading into the Codex, and have employed this code:
Code:post_title; ?>
Posted on post_date; ?>
Querying the table columns proved successful, however this is not how I would like to do this. For some reason the setup_postdata(); command just isn’t letting me access the post’s meta data as I would like to. I can live with this temporary fix for now, but would really appreciate the advice of anyone out there on this.
November 3, 2009 at 7:01 pm #66203TXChetGMemberI am also toying with this as a way to do what I want:
Code:However it is causing two instances of the posts to be displayed. Why would it cause this?
See it here: http://chetgassett.com/sand-box
*UPDATED*
Code:I am trying this now, but after instituting wp_reset_query(); the page title is just looping over, and over, and over again on the "sand-box" page above. I experience this same problem when trying to just run a loop on a page. What do you all think?
November 3, 2009 at 7:44 pm #66205 -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.