I cleaned up the code u have given and it should work as you intend.
Let me know if your still having problems.
<div id="slider">
<?php
$c = get_option('wpns_category');
$n = get_option('wpns_slices');
$s = new WP_Query( array( 'cat' => $c, 'posts_per_page' => $n ) );
if( $s->have_posts() ): while( $s->have_posts() ): $s->the_post(); global $post;
?>
<?php if(has_post_thumbnail()){ ?>
<a href="https://wordpress.stackexchange.com/questions/33600/<?php echo get_post_meta($post->ID,"slider-url", true); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php } ?>
<?php endwhile; endif;?>
</div>
Related Posts:
- Change post thumbnail using front end post edit form
- Function to replace the url of featured images in the wordpress database?
- Programmatically set thumbnail via URL using DOM and XPATH – Where to add ELSEIF
- How do you code a featured image into an XML as a jpg link, instead of using a data-id number?
- wp_get_attachment_metadata()[‘image_meta’] fetch WP metadata or EXIF?
- Copy wp_postmeta from one database to another
- How to disable WordPress from creating thumbnails?
- How to Dynamically Resize WordPress Image On-The-Fly (custom field/theme option)
- Display Category Thumbnail and links in Woo commerce
- media_sideload_image generates blank?
- Post thumbnail outside the loop
- How do I add the featured image to the_content after the first paragraph?
- Showing a placeholder/default img, if no featured image is set
- Re-order media links?
- How to show featured image CAPTION only if it exist
- Add Image Dimensions to Media Library Tab on Media Upoader
- Featured image for news page
- Fallback default image when there is no featured image
- Adding schema itemprop image to the_post_thumbnail with filters
- How to get custom image sizes into media uploader dropdown?
- wordpress responsive image srcset not working
- How do I get a random image from subset of images in media gallery?
- Why are extra 92 pixel square thumbnails created?
- wp-cli regenerate media is not working for custom sizes
- Remove dimensions from filename featured image
- PDF Image in content
- Replicate featured image functionality
- Why does the Hard Crop option Scale?
- Post Thumbnails multiple sizes
- Long Post Title Misaligning Grid with Featured Image
- How to add multiple featured images to post/page without a plugin
- How do I set “Upload Image” as detault “Set Featured Image” window?
- Featured Image won’t display on Posts page
- Get post thumbnail from subpages with a foreach loop
- Modify WP_Post before processing
- Getting images to show up in RSS Reader
- how i can increase Featured thumbnails size?
- the_post_thumbnail() Custom sizes not display correctly
- Set_post_thumbnail not resizing images
- How to inject attributes into get_the_post_thumbnail?
- MultiPostThumbnails for Custom Post Type
- Muliple featured images (or just images) per post
- WordPress Featured Image function recreate
- Using Featured Image as Hero Background
- wp_get_attachment_image_src match smallest edge
- Can’t Set Featured Image [closed]
- Resize post thumbnail produces horrible image quality..Any help?
- media-library: how to insert thumbnails with a fixed width, regardless of landscape/portrait orientation
- Post thumbnail outside of loop
- query_posts adding two “post-entry” divs
- Display a thumbnail outside of the loop for a page
- How to use get_the_title with text on the ‘alt’ of the_thumbnail array?
- remove_image_size doesn’t seem to be working
- Get Featured Image Outside Loop Not Working
- Responsive scaling of image for the_post_thumbnail() [closed]
- images not showing despite using add_theme_support(‘post-thumbnails’);
- post thumbnail: increase dimension if smaller than… Possible?
- Displaying caption with featured image
- add_theme_support post-thumbnails not working
- Trying to show WordPress category query result as background image
- How risize a thumbnail?
- custom thumbnail image size not working
- Comparison Operators not working for conditional author post thumbnails
- Assign SQL ‘post_thumbnail’ column as featured image
- Default thumb – how to set it
- How to get featured image thumbnail to open larger version in attachment page?
- How to update custom image sizes?
- featured images twenty eleven theme
- How to add featured images to posts from a category
- Change featured image when changing viewport
- Adding guiding text to the ‘Featured Image’-box in the backend
- Thumbnails are hard cropped not matter what
- Thumbnails regenerate wp_generate_attachment_metadata
- Using the_post_thumbnail do not rollback to original image if specified thumbnail does not exist
- Get author image from corresponding article in thumbnail
- Missing image size
- Automatic set a featured image from the first image’s url (or tag) in the article
- water mark on featured post image in wordpress
- Making a ‘featured image’ become the image for a full banner (top of page) image in a blog post?
- How to change text of Remove featured image
- Add space under featured image in singel post
- How to undo thumbnail regenration
- Genereate widescreen featured images in different sizes
- set_post_thumbnail() shows Unattached on backend under Media
- How to get the URL of a each custom image size of a featured image
- Recent posts show thumbnail
- Add Featured Image from Existing wp-content folder
- Featured Images missing on migrated site
- Trouble Retrieving Thumbnail URL on Front-Page
- Pointing Existing featured images to s3 bucket
- Displaying All Parent Pages as Featured Images
- Featured Images not appearing
- Editing featured image
- trouble with the_post_thumbnail
- WordPress save thumbnail but don’t show it [closed]
- Get all images from posts with maximum number and without featured image
- Display featured image as post thumbnail
- Scan for first image in post and display it [duplicate]
- Change featured thumbnail based on screen size
- Show a featured image with “Link” Post Type?