|   |   |   | ||||
| Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. | 
|    | 
| 
 | |||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. | 
|  | Thread Tools | 
|  04-26-2020, 01:21 AM | #1 | 
| Confirmed User Industry Role:  Join Date: Jan 2011 Location: Somewhere in Germany 
					Posts: 817
				 | 
				
				Need help with one line if php/html
			 Hey folks. I want to add an extra line of code to my wordpress site, but I can't fgure out the correct code. Maybe someone can help me? Every post has a featured image. I want to add a line of code, to that the the direct link to the featured image appears as a link in the theme. Must be something like Code: <a href='$postthumbnail-whatever-url' title='$thumbnail-title-or-so' target="_blank">CLICK HERE</a> 
				__________________ I know, my english is bad. But your german might be even worse   | 
|   |           | 
|  04-26-2020, 06:57 AM | #2 | |
| Confirmed User Industry Role:  Join Date: Apr 2010 
					Posts: 1,107
				 | Try it like this Quote: 
 | |
|   |           | 
|  04-26-2020, 08:23 AM | #3 | 
| Confirmed User Industry Role:  Join Date: Jan 2011 Location: Somewhere in Germany 
					Posts: 817
				 | If you mean this Code: <a href='<?php echo $postthumbnail; ?>' title='<?php echo $thumbnail; ?>' target="_blank">CLICK HERE</a> This code points to the post-url. A need to point it to the post-thumbnail-url. But we are getting closer. 
				__________________ I know, my english is bad. But your german might be even worse   | 
|   |           | 
|  04-28-2020, 11:18 AM | #4 | 
| Confirmed User Join Date: Jun 2003 
					Posts: 3,285
				 | // outside the loop Code: 
    $post = get_post(99);
    $thumb_url = get_the_post_thumbnail_url($post->ID,'full'); 
    echo '<a href="'.esc_url($thumb_url).'">Click Here</a>';Code:     while ( have_posts() ) {
        the_post(); 
        $thumb_url = get_the_post_thumbnail_url(get_the_ID(),'full'); 
        echo '<a href="'.esc_url($thumb_url).'">Click here</a>';
    endwhile; 
				__________________ dead. | 
|   |           |