WordPress.org

Ready to get started?Download WordPress

Forums

WP Nivo Slider
Add images without post (5 posts)

  1. tigron
    Member
    Posted 3 years ago #

    Is there a way to add images to the slider without having it connected to a post ? I'm currently using the featured image option so I have to create a post and then use the image as a featured image.

    http://wordpress.org/extend/plugins/wp-nivo-slider/

  2. alphamediahouse
    Member
    Posted 3 years ago #

    Hey Tigron did you ever get an answer to this or figure it out? I'm trying to do the same thing and don't want the images to go to any post

  3. Smos
    Member
    Posted 3 years ago #

    Me too.

  4. tigron
    Member
    Posted 3 years ago #

    I still haven't figured this out. Has anyone else got any further ?

  5. Smos
    Member
    Posted 3 years ago #

    I think I found a solution. Around every image in the nivo slider there's a link to the post. I simply removed that link so you can't click on the images in the slider.

    In the plugin editor, go to the code files of the WP Nivo Slider plugin.
    There you have to open the wp-nivo-slider.php file. Look for the opening tag of <div id="slider">.
    A couple of lines below that you have the following code:

    <?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' ); if( have_posts() ) : while( have_posts() ) : the_post(); ?>
    	<?php if(has_post_thumbnail()) : ?>
    	<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    		<?php the_post_thumbnail(); ?>
    	</a>
    	<?php endif ?>
    	<?php endwhile; endif;?>
    	<?php wp_reset_query();?>

    You have to remove the <a> tag from the code so your link is gone.
    Then you should have something like this:

    <?php query_posts( 'cat='.$category.'&posts_per_page=$n_slices' ); if( have_posts() ) : while( have_posts() ) : the_post(); ?>
    	<?php if(has_post_thumbnail()) : ?>
    	<?php the_post_thumbnail(); ?>
    	<?php endif ?>
    	<?php endwhile; endif;?>
    	<?php wp_reset_query();?>

    It worked for me, I hope it does for you too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic