WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] feaured image linking but I have one giant permalink (4 posts)

  1. Miz.Michele
    Member
    Posted 1 year ago #

    I've been having a lot of problems trying to get the featured image to link to the post. I finally got it but now the entire excerpt is a giant permalink

    this is the line I'm having issues with

    [please mark any code according to the forum guidelines - http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    $title = get_the_title();
    	the_post_thumbnail(array($width,$height), array('alt' => $title));

    I replaced it with

    [the code below is corrupted - please re-post it]

    $title = get_the_title();
    	?><a>"><?php the_post_thumbnail(array($width,$height), array('alt' => $title));?><?php;

    and now the image goes to the permalink and so does the excerpt
    http://www.celebrityfeast.com

    Any ideas? I'm stumped

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    http://www.w3schools.com/html/html_links.asp

    you have possibly forgotten to add the closing link tag </a> after the featured image.

  3. Miz.Michele
    Member
    Posted 1 year ago #

    Thanks but I am not sure where to add instead of the php at the end or before it? I am so sick of getting parse errors - -)

  4. Miz.Michele
    Member
    Posted 1 year ago #

    I did it and it did work - no more giant permalink

    Thanks a lot

Topic Closed

This topic has been closed to new replies.

About this Topic