Community Forums › Forums › Archived Forums › Design Tips and Tricks › Post Title = Outgoing Link
- This topic has 9 replies, 3 voices, and was last updated 11 years, 3 months ago by Susan.
-
AuthorPosts
-
January 16, 2013 at 11:39 am #12335pfbeatMember
I know this is a long shot, but is there anyway to configure the eleven40 theme so that the Post Title links not to a permalink on your own site, but instead as an outgoing link to another site?
To see what I mean as an example from another site, look at this blog post, and hover your mouse over the post title -- Stay Curious -- and you'll see that it links outward. (The permalink is the little star next to it).
Thanks.
January 16, 2013 at 11:45 am #12340SusanModeratorHave you tried using the custom URL at the bottom of a page and/or post?
January 16, 2013 at 11:49 am #12343pfbeatMemberDo you mean at the bottom of the post, when I go to add a new one?
I see five "custom" fields under Theme SEO Settings, "custom tracking/conversion code", and "custom body/post" class, but no custom URL field.
January 16, 2013 at 12:20 pm #12354RonnyMacMemberYes. You'll need the Daring Fireball-style Linked List Plugin from Y.J. Soon. Installation is typical WP plugin and setup is equally straightforward. And it's priced right.
Then the fun begins.
Getting the DF-style link to show up using a Genesis theme takes a little more work and Genesis Simple Hooks.
I'm working on a project to replicate that link out style on two Genesis sites. It gets tricky because of the unique way DF uses CSS for the link outs, but here's how I made it work.
This code should be placed in the 'genesis_post_title Hook' in Genesis Simple Hooks. Unhook the function and click on the execute PHP. The code also assumes two post categories. One is called 'linked' for the link outs, and the other is for longer 'articles' without a link out (traditional links).
<?php if (is_single() AND in_category('linked') AND is_linked_list()): ?> <div class="link-date"><?php echo the_date(); ?></div><!--END link date--> <dl class="linked"> <dt><a href="<?php the_linked_list_link(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></dt><dd></dd></dl><!--END linked--> <?php else: ?> <?php endif; ?> <?php if (is_front_page() AND in_category('linked')): ?> <div class="link-date"><?php echo the_date(); ?></div><!--END link date--> <dl class="linked"> <dt><a href="<?php the_linked_list_link(); ?>" title="<?php the_title(); ?>" class="link"><?php the_title(); ?></a> <a class="permalink" title="Permanent Link to '<?php the_title(); ?>'" href="<?php the_permalink(); ?>">></a></dt><dd></dd></dl><!--END linked--> <?php else: ?> <?php endif; ?> <?php if (is_single() AND in_category('articles')): ?> <h1 class="entry-title"><?php the_title(); ?></h1> <div class="article-date"><?php echo the_date(); ?></div><!--END article date--> <?php else: ?> <?php endif; ?> <?php if (is_front_page() AND in_category('articles')): ?> <div class="spook"></div><!--END spook--> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2><div class="article-date"><?php echo get_the_date(); ?></div><!--END article date--> <?php else: ?> <?php endif; ?> <?php if (is_archive() AND in_category('articles')): ?> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2><div class="article-date"><?php echo the_date(); ?></div><!--END article date--> <?php else: ?> <?php endif; ?> <?php if (is_archive() AND in_category('linked') AND is_linked_list()): ?> <div class="link-date"><?php echo the_date(); ?></div><!--END link date--> <dl class="linked"> <dt><a href="<?php the_linked_list_link(); ?>" title="<?php the_title(); ?>" class="link"><?php the_title(); ?></a> <a class="permalink" title="Permanent Link to '<?php the_title(); ?>'" href="<?php the_permalink(); ?>">»</a></dt><dd></dd></dl><!--END linked--> <?php else: ?> <?php endif; ?> <?php if (is_search() AND in_category('articles')): ?> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2><div class="article-date"><?php echo the_date(); ?></div><!--END article date--> <?php else: ?> <?php endif; ?> <?php if (is_search() AND in_category('linked')): ?> <div class="link-date"><?php echo the_date(); ?></div><!--END link date--> <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <?php else: ?> <?php endif; ?> <?php if (is_page()): ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php else: ?> <?php endif; ?>
This also segregates the categories Articles and Linked so they display differently in category mode, and in Search mode.
Sorry, my code isn't all that pretty (I don't even know how to spell PHP), but it works and returns results exactly as you expect on DF. I've also included the CSS tags but you'll have to write your own CSS to match (and that gets tricky, too, especially on the mouseover of the link out, which also highlights the permalink glyph). In this case I use the right angle quotes instead of the DF star.
ronnymac
—
Ron McElfresh
Honolulu, HI
—
http://mac360.com/
http://mcelfresh.org/
http://mcsolo.com/
http://pixobebo.com/
http://noodlemac.com/January 16, 2013 at 12:36 pm #12360pfbeatMemberAppreciate the reply, Ronny, though that may be a little more complicated that I'm capable of with my coding skills, lol.
January 16, 2013 at 12:49 pm #12362RonnyMacMemberAs I said, I don't know how to spell PHP or CSS. I just muck my way through the code using trial and error until something works. Infinite number of monkeys typing kind of thing.
If there's an easier way, I don't know what it is. The DFLL plugin will work on the WP TwentyTen theme, but the code to make it work DF-style needs to be dropped into a Genesis theme, and the easy way to do that is through the Genesis Simple Hooks plugin.
I've seen a few other methods for putting an outbound link where the title is (instead of the permalink), but the DFLL method is the best.
ronnymac
—
Ron McElfresh
Honolulu, HI
—
http://mac360.com/
http://mcelfresh.org/
http://mcsolo.com/
http://pixobebo.com/
http://noodlemac.com/January 16, 2013 at 1:16 pm #12372pfbeatMemberI got up until this point:
"This code should be placed in the ‘genesis_post_title Hook’ in Genesis Simple Hooks. Unhook the function and click on the execute PHP."
It then removed post titles for ALL my posts! Also, I have no idea how to "write my own CSS."
I do appreciate the replies, though. I'm just surprised there's not an easy way to do this. I mean, you can do this in Tumblr in three seconds.
January 16, 2013 at 1:30 pm #12375SusanModeratorI do appreciate the replies, though. I’m just surprised there’s not an easy way to do this. I mean, you can do this in Tumblr in three seconds.
I can't access my test site from my current location, so I can't show you a screenshot of where I directed you in my first response, but wanted to provide a link to a thread where I gave essentially the same answer, and it worked for that particular user:
January 16, 2013 at 1:41 pm #12379pfbeatMemberThat plug-in did the trick! So easy! THANK YOU!!!
January 16, 2013 at 1:44 pm #12380SusanModeratorI'm glad that resolved it! I'm going to close this thread as resolved.
-
AuthorPosts
- The topic ‘Post Title = Outgoing Link’ is closed to new replies.