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 »

Post headers on homepage - Link to pages instead?


  #1  
Old Mar 10, 2009, 04: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, 03: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, 04: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, 12: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, 03: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 01:39 PM
multiple pages... (homepage) designer666 Atahualpa 3 Wordpress theme 1 May 12, 2009 09:43 AM
how do i get comments to show up on homepage for each post??? drewjones Comments, trackbacks & pings 2 Apr 15, 2009 07:04 PM
Post PHP on one page only, and not homepage blueprairie Plugins & Atahualpa 2 Apr 2, 2009 07:28 AM
Dreamweaver homepage link problem Dealer Bicycles Atahualpa 3 Wordpress theme 4 Jan 31, 2009 04:38 PM


All times are GMT -6. The time now is 11:05 AM.


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