Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Featured posts in horizontal bar 1


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Feb 3, 2009, 12:08 AM
technstuff
 
6 posts · Jan 2009
Featured posts in horizontal bar 1

I am trying to use horizontal bar 1 as a place to display 3 featured posts without having to hardcode the links into the theme. Here is what I have tried so far:

$horizontal_bar1 = '<div class="horbar1">
<div class="featurebox"><a href=" '. get_tag_link(9) .' ">'. get_the_excerpt(66) .'</a></div>
<div class="featurebox"><a href=" '. get_tag_link(10) .' ">Title of post here</a></div>
<div class="featurebox"><a href=" '. get_tag_link(11) .' "></a></div>
</div>';

I did this in the bfa_header_config file and you can probably see that I was thinking I could use specific tags for those posts that I want to feature ("feature 1", "feature 2", etc.) and they correspond to the tag id's (9, 10, etc.). I know it probably looks pretty messy cuz I've never used php. The tag thing is working as far as getting me the link to the specific post I want to feature. But my problem is that I want to also get the post title between the <a href> and </a> using another function if possible. And then I want to take an excerpt of that same post to put below the respective titles. So far I've found that I need to get the post ID and the php functions I've found to do that need to be put into "The Loop" (scary! lol). But I don't want to hardcode the ID into this because my featured posts will change from time to time. I just want to be able to slap on a feature tag in the backend and get it to show up in the featurebox. I got this far but now I feel like I'm in way over my head. Any ideas? Thanks in advance.
  #2  
Old Feb 3, 2009, 04:11 AM
Flynn's Avatar
Flynn
 
3,754 posts · Oct 2008
Munich, Germany
To get various info about a post (or a "Page" page) outside of the loop use

PHP Code:
$post_id $wp_query->get_queried_object_id();
$post_data get_post($post_idARRAY_A);
$post_author_id $post_data['post_author'];

$post_title $post_data['post_title'];
$post_content $post_data['post_content'];
$post_excerpt $post_data['post_excerpt'];
$post_permalink get_permalink($post_id);
$post_date $post_data['post_date'];
$post_author get_author_name($post_author_id);
$post_comment_count $post_data['comment_count']; 
Look also into bfa_postinfo.php on how to get various post related info

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
NAVT plugin and horizontal menu bar coldar75 Plugins & Atahualpa 1 Jul 7, 2009 08:47 AM
How to create a homepage with links to featured posts scrubbs Post-Kicker, -Byline & -Footer 9 May 31, 2009 06:22 PM
Category Menu Bar vertical in IE, horizontal in Firefox carnival Page & Category Menu Bars 1 Apr 6, 2009 05:53 PM
Unwanted horizontal scroll bar mwiwchar Atahualpa 3 Wordpress theme 2 Mar 4, 2009 04:11 PM
Sticking an Adsense banner in the horizontal bar #2 in header? syuzhet Header configuration & styling 1 Feb 11, 2009 07:00 PM


All times are GMT -6. The time now is 01:15 PM.


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