Support » Fixing WordPress » How to add a link to a headline

  • Is there a way I can make some headlines for my posts have links to other websites? I want to create a category that has the appearance of an RSS feed but that I add content to myself. RSS feeds feature linking headlines so I want to offer the same feature. Is this possible in WordPress with or without a plug in. I have searched and not found an answer or solution.
    Thanks
    Here is my site
    TimothyMiles.com

Viewing 1 replies (of 1 total)
  • Could you not use the custom field template plugin, then create an extra field called link. This is where you could put your url to the other site, then on your template code (index.php) or whatever, use something like:

    <?php
    			  $Right_Promo = get_post_meta($post->ID, "Right_Promo", true );
    			  $Right_Promo_Link = get_post_meta($post->ID, "Right_Promo_Link", true );
    			  if ( ( $Right_Promo_Link && '' != $Right_Promo_Link ) ) :
    
    				echo '<a href=">';
    				$key="Right_Promo_Link"; echo get_post_meta($post->ID, $key, true);
    				echo '">';
    				echo wp_get_attachment_image($Right_Promo, $size='post-thumbnails');
    				echo '</a>';
    
    			  else :
    
    				$Right_Promo = get_post_meta($post->ID, "Right_Promo", true );
    				if ( ( $Right_Promo && '' != $Right_Promo ) ) :
    					echo wp_get_attachment_image($Right_Promo, $size='post-thumbnails');
    				endif;
    
    			  endif;
    			  ?>

    You will need to alter tha above to suit. I’ve used the above on a thumbnail image, allowing the thumbnail to link or not

    HTH

Viewing 1 replies (of 1 total)
  • The topic ‘How to add a link to a headline’ is closed to new replies.