Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Post headers on homepage - Link to pages instead?


  #1  
Old Mar 10, 2009, 05:14 AM
ray-zin
 
14 posts · Mar 2009
Hi Is it possibel to change this piece of code in the index.php to point to relevant page slugs instead of post slugs?
Code:
		<h2><?php 
		if( !is_single() AND !is_page() ) { ?>
			 <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php
			if (function_exists('the_title_attribute')) { 
				the_title_attribute();
			} 
			elseif (function_exists('the_title')) { 
				the_title();
			} ?>"><?php 
		} the_title(); 
		if( !is_single() AND !is_page() ) { ?>
			</a><?php 
		} ?>
		</h2>
Thanks in advance for your help.
  #2  
Old Mar 10, 2009, 04:21 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
What do you mean with "point to". Provide more details, please
  #3  
Old Mar 10, 2009, 05:40 PM
ray-zin
 
14 posts · Mar 2009
Hi Flynn.

What I meant is that the piece of code above turns the post header into a link to the post's perm. link.
How can I change this to instead build a url for a different page instead of the post's perm. address?

eg: Lets say the post has a slug of: "target-1" and I give a page that I create the same slug of: "target-1" can this code be changed somehow to point to the PAGE slug instead of the POST slug?

I hope this makes sense. I'm still learning WP and not familiar with all the terms etc.
  #4  
Old Mar 11, 2009, 01:46 AM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
In that code, replace

PHP Code:
<?php the_permalink() ?>
with

PHP Code:
<?php echo get_option('home') . '/' $post->post_name '/'?>
This would will create http://your-wordpress-base-url.com/post-slug/
  #5  
Old Mar 11, 2009, 04:45 PM
ray-zin
 
14 posts · Mar 2009
Woohoo!!! Absolutely awesome Flynn...

Thanks.

I now have list of posts that link to static pages as long as I give them the same slugs and ammend the default slug directory.

Brilliant!!!

My page is so far from a blog its not even funny ;-)

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Latest Comment From Each Post on Homepage And Multi-page pages noyell Post-Kicker, -Byline & -Footer 3 Aug 8, 2009 02:39 PM
multiple pages... (homepage) designer666 Atahualpa 3 Wordpress theme 1 May 12, 2009 10:43 AM
how do i get comments to show up on homepage for each post??? drewjones Comments, trackbacks & pings 2 Apr 15, 2009 08:04 PM
Post PHP on one page only, and not homepage blueprairie Plugins & Atahualpa 2 Apr 2, 2009 08:28 AM
Dreamweaver homepage link problem Dealer Bicycles Atahualpa 3 Wordpress theme 4 Jan 31, 2009 05:38 PM


All times are GMT -6. The time now is 12:03 PM.


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