Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

Featured posts in horizontal bar 1


  #1  
Old Feb 3, 2009, 01:08 AM
technstuff
 
6 posts · Jan 2009
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, 05:11 AM
Flynn's Avatar
Flynn
 
3,768 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



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


All times are GMT -6. The time now is 01:30 AM.


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