# Remove link to Post/Page for featured image

**URL:** <https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169>\
**Category:** Travelify\
**Created:** [October 14, 2013, 4:29pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169 "2013-10-14T16:29:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![client](https://colorlibsupport.com/user_avatar/colorlibsupport.com/client/32/2549_2.png) [@client](https://colorlibsupport.com/u/client)\
**Post date:** [October 14, 2013, 4:29pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/1 "2013-10-14T16:29:56Z")

</div>

Hi Aigars,

Very well done with this theme. I have just one question: Is it possible to remove the link from the slider, because I just want to use the slider to show some nice pictures without linking posts. 🙂 I think I have to comment out something in the “header-extension.php”,… Could you give me some support? Thanks!

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [October 14, 2013, 4:30pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/2 "2013-10-14T16:30:58Z")

</div>

Just look for line 336 on header-extensions.php and from there replace it with this code from here.

```auto
if ( ! function_exists( 'travelify_featured_post_slider' ) ) :
/**
 * display featured post slider
 *
 * @uses set_transient and delete_transient
 */
function travelify_featured_post_slider() {	
	global $post;
		
	global $travelify_theme_options_settings;
   $options = $travelify_theme_options_settings;
	
	$travelify_featured_post_slider = '';
	if( ( !$travelify_featured_post_slider = get_transient( 'travelify_featured_post_slider' ) ) && !empty( $options['featured_post_slider'] ) ) {	
		$travelify_featured_post_slider .= '
		<section class="featured-slider"><div class="slider-cycle">';
			$get_featured_posts = new WP_Query( array(
				'posts_per_page' => $options['slider_quantity'],
				'post_type' => array( 'post', 'page' ),
				'post__in' => $options['featured_post_slider'],
				'orderby' => 'post__in',
				'ignore_sticky_posts' => 1 // ignore sticky posts
			));
			$i=0; while ( $get_featured_posts->have_posts()) : $get_featured_posts->the_post(); $i++;
				$title_attribute = apply_filters( 'the_title', get_the_title( $post->ID ) );
				$excerpt = get_the_excerpt();
				if ( 1 == $i ) { $classes = "slides displayblock"; } else { $classes = "slides displaynone"; }
				$travelify_featured_post_slider .= '
				<div class="'.$classes.'">';
						if( has_post_thumbnail() ) {
	
							$travelify_featured_post_slider .= get_the_post_thumbnail( $post->ID, 'slider', array( 'title' => esc_attr( $title_attribute ), 'alt' => esc_attr( $title_attribute ), 'class'	=> 'pngfix' ) ).'</figure>';
						}
						if( $title_attribute != '' || $excerpt !='' ) {
						$travelify_featured_post_slider .= '
							<article class="featured-text">';
							if( $title_attribute !='' ) {
									$travelify_featured_post_slider .= '<div class="featured-title">'. get_the_title() . '</div><!-- .featured-title -->';
							}
							if( $excerpt !='' ) {								
								$travelify_featured_post_slider .= '<div class="featured-content">'.$excerpt.'</div><!-- .featured-content -->';
							}
						$travelify_featured_post_slider .= '
							</article><!-- .featured-text -->';
						}
				$travelify_featured_post_slider .= '
				</div><!-- .slides -->';
			endwhile; wp_reset_query();
		$travelify_featured_post_slider .= '</div>				
		<nav id="controllers" class="clearfix">
		</nav><!-- #controllers --></section><!-- .featured-slider -->';
			
	set_transient( 'travelify_featured_post_slider', $travelify_featured_post_slider, 86940 );
	}
	echo $travelify_featured_post_slider;	
}
endif;

```

I guess you will see how much you have to replace. If you are having problems, please let me know and I will try to give you a better explanation.

---

<div class="post-metadata">

**Author:** ![client](https://colorlibsupport.com/user_avatar/colorlibsupport.com/client/32/2549_2.png) [@client](https://colorlibsupport.com/u/client)\
**Post date:** [October 14, 2013, 4:31pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/3 "2013-10-14T16:31:15Z")

</div>

thanks for you answer! I replaced line 336 to 394 with your code, but with no success… It is still the same situation,

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [October 14, 2013, 4:31pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/4 "2013-10-14T16:31:23Z")

</div>

Just open any WordPress post and hit “Update” it should do the trick.

---

<div class="post-metadata">

**Author:** ![client](https://colorlibsupport.com/user_avatar/colorlibsupport.com/client/32/2549_2.png) [@client](https://colorlibsupport.com/u/client)\
**Post date:** [October 14, 2013, 4:31pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/5 "2013-10-14T16:31:29Z")

</div>

Works, thank you!

---

<div class="post-metadata">

**Author:** ![trialme](https://colorlibsupport.com/user_avatar/colorlibsupport.com/trialme/32/2492_2.png) [@trialme](https://colorlibsupport.com/u/trialme)\
**Post date:** [November 18, 2013, 4:28pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/6 "2013-11-18T16:28:47Z")

</div>

is it possible to remove Title and Descriptions too from slider?

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [November 18, 2013, 5:19pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/7 "2013-11-18T17:19:30Z")

</div>

Add this to Theme Options - Other - Custom CSS

```auto
.featured-text {
    display: none;
}

```

---

<div class="post-metadata">

**Author:** ![johnopolo](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@johnopolo](https://colorlibsupport.com/u/johnopolo)\
**Post date:** [December 23, 2013, 2:57pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/8 "2013-12-23T14:57:38Z")

</div>

Ha! I’m so pleased I managed to find this post. Thank you, I’ll try it out tomorrow 🙂

---

<div class="post-metadata">

**Author:** ![johnopolo](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@johnopolo](https://colorlibsupport.com/u/johnopolo)\
**Post date:** [December 28, 2013, 11:17am UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/9 "2013-12-28T11:17:40Z")

</div>

Thank you for the assistance on this - it worked first time 🙂

However, there is a slight issue: When the mouse pointer is on the slider image, an “alt” box now puts in an appearance. It’s displaying the title (in my case) but I don’t want to see the alt box. I have tried fiddling around but to no avail. Please assist.

I would also like to know whether a theme update (or any other update) would necessitate me patching the .php file again. Ta ever so much …

---

<div class="post-metadata">

**Author:** ![johnopolo](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@johnopolo](https://colorlibsupport.com/u/johnopolo)\
**Post date:** [December 28, 2013, 1:50pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/10 "2013-12-28T13:50:23Z")

</div>

Oops, I’m back with another problem on [http://laos.twocrocs.com/](http://laos.twocrocs.com/) The slider images are being cut off at the top. I have uploaded images with dimensions 1018 x 540 (that’s what they are in the media library) but when they are displayed, the height has been changed to 460: . Again I’ve messed around but to no avail. I really would appreciate a solution to this issue.

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [December 28, 2013, 6:36pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/11 "2013-12-28T18:36:25Z")

</div>

Images are resized automatically to fit slider. You can change default values via functions.php file. Right now featured image size is defined like this

`add_image_size( 'slider', 1018, 460, true );`

You can adjust that but you will have to regenerate thumbnails because WordPress doesn’t do it automatically. There are several plugins for that, such as [http://wordpress.org/plugins/regenerate-thumbnails/](http://wordpress.org/plugins/regenerate-thumbnails/)

---

<div class="post-metadata">

**Author:** ![johnopolo](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/j/e79b87/32.png) [@johnopolo](https://colorlibsupport.com/u/johnopolo)\
**Post date:** [December 29, 2013, 12:02am UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/12 "2013-12-29T00:02:08Z")

</div>

Thanks Aigars, I really do appreciate your assistance - support at the level you provide is rare indeed!  
A few points though:

1. Obviously I want to maintain the site as is. So what kind of update(s) will necessitate me having to make the changes to the .php files again?
2. Is there any chance of getting rid of the “alt” box? If not, I suppose I could un-title the relevant posts …
3. Regarding the slider image size, the on-screen Theme documentation (Theme Options) states that the size is “recommended”. Clearly, as matters stand, the recommended size is actually mandatory. I’m definitely not going to be the only one facing this issue so perhaps it needs to be addressed at the Theme level. Bear in mind that a thin wide image is expected for a header slider but something in the body really should be more flexible. Many people will want to show off their images in this slider and 1018 x 460 isn’t a good size for doing that - the height needs to be user defined…

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [December 29, 2013, 8:05pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/13 "2013-12-29T20:05:58Z")

</div>

1. Any changes made directly inside theme files (css, php, js, etc) will be overwritten with the theme update. WordPress doesn’t bother checking what’s new in the theme and it overwrites the entire directory.

2. The best options is to make all these changes via Child Theme. I can help you to setup slider properly via Child Theme but it is out of scope of free support as it takes a lot of time to implement.

3. It is not “mandatory”, because any image size will work just fine. The best results will be when you use recommended image size since it won’t be resized at all.  
Resizing is done because it is requires as [WordPress.org](http://WordPress.org) “best practices”. If developers would allow to upload any image size without resizing, some would come up with 30MB image directly from Canon EOS 5D Mark III or similar camera. Imagine website when 10 images would be used as featured images and 5 for slider. This is why we must limit image size.

Featured image size can be simply changed by adding this value to Child Theme `functions.php` file and it will overwrite original values.

`add_image_size( 'slider', 1018, 460, true );`

---

<div class="post-metadata">

**Author:** ![pjbar](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@pjbar](https://colorlibsupport.com/u/pjbar)\
**Post date:** [January 22, 2014, 9:09pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/14 "2014-01-22T21:09:55Z")

</div>

Hi,

Does the mod for removing links from the slider (detailed above) work for the current version 1.5.0? If not, can you show the code needed?

A future feature: a config option to turn on/off on the slider links. Right now I don’t need them however, can imagine situations where it can be really useful have the links.

What are the changes from the last version?

Many thanks, PJ

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [January 23, 2014, 9:38am UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/15 "2014-01-23T09:38:48Z")

</div>

This code will still work as of Travelify 1.5.0.

If you feel that you need a more control over where these slides are pointing, you can use plugin such as this one: [http://wordpress.org/plugins/page-links-to/](http://wordpress.org/plugins/page-links-to/)

You can use any link there that point inside or even outside your website.

Changes can be found on Theme readme.txt file: [https://colorlib.com/travelify/wp-content/themes/travelify/readme.txt](https://colorlib.com/travelify/wp-content/themes/travelify/readme.txt)

This is a must have update because it fixes several bugs such as Navigation bug, Page and Blog title placement. Other changes are translation related but many users will highly appreciate them.

---

<div class="post-metadata">

**Author:** ![pjbar](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@pjbar](https://colorlibsupport.com/u/pjbar)\
**Post date:** [January 23, 2014, 4:30pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/16 "2014-01-23T16:30:52Z")

</div>

Thanks for the reply and plug-in suggestion.

If I understand the Codex correctly, the mod can go in header-extensions.php in a child theme.

Great support as always.

Rgds, PJ

---

<div class="post-metadata">

**Author:** ![aigars-silkalns](https://colorlibsupport.com/user_avatar/colorlibsupport.com/aigars-silkalns/32/13469_2.png) [@aigars-silkalns](https://colorlibsupport.com/u/aigars-silkalns)\
**Post date:** [January 23, 2014, 5:08pm UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/17 "2014-01-23T17:08:56Z")

</div>

WordPress doesn’t recognize custom files via Child Theme and will work only with page.php, single.php, archive.php and other default files. However, you can modify and copy/paste functions from header-extension.php into Child Theme functions.php and it will work like it should.It will basically replace original functions.

---

<div class="post-metadata">

**Author:** ![jgwestongmail-com](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@jgwestongmail-com](https://colorlibsupport.com/u/jgwestongmail-com)\
**Post date:** [February 2, 2014, 2:31am UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/18 "2014-02-02T02:31:13Z")

</div>

I had successfully used the code above to remove links from the featured slider in the last version of Travelify. I just updated the theme and re-inserted the code above into header-extensions.php but there are still links in the featured slider (which I would like to remove).

Do you have any suggestions how to address this?

Thank you.

---

<div class="post-metadata">

**Author:** ![jgwestongmail-com](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@jgwestongmail-com](https://colorlibsupport.com/u/jgwestongmail-com)\
**Post date:** [February 2, 2014, 2:37am UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/19 "2014-02-02T02:37:39Z")

</div>

Nevermimd - forgot to hit ‘update’ in a post. It is working now. Thank you for all the support in this forum!

---

<div class="post-metadata">

**Author:** ![windomearle](https://colorlibsupport.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@windomearle](https://colorlibsupport.com/u/windomearle)\
**Post date:** [February 3, 2014, 11:39am UTC](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169/20 "2014-02-03T11:39:35Z")

</div>

Hi Aigars,

Thanks for this impressive wp-theme Travelify! I managed to find the file you said header-extensions.php and I replaced the code with yours. Did update in each post and now there are no links, it works like a champ ahah! Many thanks!

The full path for the file is themes \> travelify \> library \> structure Maybe this can help someone 🙂

Have a good day!

[Next page](https://colorlibsupport.com/t/remove-link-to-post-page-for-featured-image/5169.md?page=2)
