Support » Theme: WP-Forge » Remove Featured Image Link and Set Featured Image to Full Width

  • Howdy,

    Is there a preferred method using WP-Forge to remove the featured image link / permalink while on the associated page itself?

    Is there also a preferred method using WP-Forge to make featured images their full width or a specified width and height (when you’re on the associated page itself)?

    Thanks for your time.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author ThemeAWESOME

    (@tsquez)

    Hey there,

    Sorry for the long delay in responding. I didn’t see this email until now. So very sorry.

    The featured image for a regular page is 800 pixels wide with unlimited height. A full width page featured image is 1200 pixels wide, also with unlimited height.

    I’m not really sure what you’re asking, if there isn’t a featured image set on a page, then it wont show and there will also be no link.

    Also if you want to set the image to 100% width, then I would use the Full-Width | No Sidebars page template.

    Again not sure what your asking, so if you could clarify a little bit more that would be helpful. Thank you.

    Howdy,

    Thanks for your reply and it’s all good; I was in no rush with this.

    I am looking to make the featured images wider than 1200px wide (1287px wide by 300px height). Already done so with CSS, though the 1200px wide image is being created and called rather than the full width 1287px wide image, thus the featured image appears slightly blurred.

    I am also looking to remove the link that appears on the individual page or post featured image. For example, if I visit a blog post or certain page (example.com/contact-us or example.com/a-example-blog-post), the featured image still has a link to itself, though I wish to remove this extra link to itself, while keeping links that would appear on a blog listing / posts category (eg. No featured image link on the individual page/post [example.com/a-example-blog-post] but still have featured image links on a blog listing / category page [example.com/blog]).

    Let me know if you require any further information.

    Cheers again for your help.

    Theme Author ThemeAWESOME

    (@tsquez)

    Hi there again sorry for the delay, my actual job takes up a lot of my time.

    I understand what you are trying to do now. If you want to set the featured image to a larger size, the way to do that is to create a new post thumb size in your functions.php file. You can learn how to do that here: https://codex.wordpress.org/Post_Thumbnails.

    In WP-Forge, the full width thumbnail is set like this: add_image_size('full-width-thumb', 1200, 9999 ); – This is basically saying the full width thumb needs to be 1200px wide and the height can be whatever it needs to be to make that happen. And it’s called in post format files, i.e. content.php or content-home.php like this: the_post_thumbnail('full-width-thumb'); You will have to look in all the files to find where this is is added and then copy all those files over to your child theme so they are not overwritten on an update.

    In your case you could something like this: add_image_size('<strong>larger</strong>-width-thumb',1287,300 ); (notice how I changed “full” to “larger” and then you would replace the_post_thumbnail('full-width-thumb'); with this the_post_thumbnail('larger-width-thumb'); – you can name your new image size whatever you want, entirely up to you just make sure to call it properly.

    Now in regards to the featured image being linked all over the place, this function is located in functions.php. You can find this by searching for “// Link all post thumbnals to the post permalink” (yeah spelled thumbnails incorrectly, its fixed in the update) – This function is what adds the link to all post thumbnails, even in single post view.

    You can remove this filter by applying this remove_filter('post_thumbnail_html','wpforge_link_postthumb',10,3); in your child themes function file. This will of course remove the link applied to all featured images.

    And if you want to have the post/page link still applied to the featured image in blog view you can simply follow this: https://codex.wordpress.org/Function_Reference/the_post_thumbnail_url – this will show you how to add the permalink to featured images in blog view.

    Hope this helps.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Featured Image Link and Set Featured Image to Full Width’ is closed to new replies.