My muTags works ok but the Link to the blogs shows about as ?p=X
I have fancy perms enabled.
This is the source
<h2><a href="<?php the_guid() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
How do i get it to output the actual permalink rather than the ID ? When try get_blog_permalink ..it only shows mainblog.com/2008/08/post-name (which is 404) instead of subdomain.mainblog.com/2008/08/post-name.
I'm sure its something simple i'm overlooking ..forgive me if I annoy you :D
musnake
Member
Posted 16 years ago #
Well, the code does what it is told.
Your href= the output of the function the_guid
If you want it to link to the permalink, tell it to do that...
http://codex.wordpress.org/Template_Tags/the_permalink
http://codex.wordpress.org/Template_Tags/get_permalink
There's a difference between the two...
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
That's what I'm saying!
<?php the_permalink(); ?>
is incorrect for what I want to display. It gives you mainblog.com/2008/08/post-name instead of subdomain.mainblog.com/2008/08/post-name.
Whats the correct tag for that ? Thanks.
cafespain
Member
Posted 16 years ago #
I've always used the_permalink (or get_permalink) and they've worked fine for me.
Is the_title() returning the correct post title?
Yeah the correct title is being return.
Note that this is on the main blog and i'm trying to display tag results to blogs.
I am having the same problem. Using the_guid, the link points to user.domain.com/?p=3. When I use the_permalink, the link points to domain.com/2008/9/19/pretty-permalink/. When I use get_permalink, it points to domain.com/tag/tagname.
Also, is there a way to get the tag links in the subdomains to point to the main blog's tag pages like WordPress.com does? Just curious.
Klark0
Member
Posted 16 years ago #
You need to use <?php echo get_blog_permalink($post->blog_id, get_the_ID()); ?>
About your second question... I've been searching for a while now on how to do that. No luck yet.
Thanks Klark0 for the help. The correct permalink is showing up now.