WordPress.org

Forums

Smooth Slider
posts appearing twice on home page (4 posts)

  1. hunted by a geek
    Member
    Posted 2 years ago #

    Hello, how can I have so that the featured post only features on the home page and not again in the post excerpts below the featured area? They only need to appear once on the page or else double-vision happens, and when viewing on a mobile device, the post will appear twice directly after one another. My theme was originally set so this wouldn't happen but smooth slider seems to have cancelled this out:

    <?php
    $count = 1;
    if (is_home()) {
    	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	query_posts(array(
    		'post__not_in' => $do_not_duplicate,
    		'paged' => $paged
    	)); }
    if ( function_exists( 'get_smooth_slider' ) ) { get_smooth_slider(); }
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    Thanks!

    http://wordpress.org/extend/plugins/smooth-slider/

  2. slidervilla
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    If you want the Smooth Slider only on homepage of your site, then you need to have the smooth slider template tag inside the is_home() condition, as mentioned below,

    <?php
    $count = 1;
    if (is_home()) {
    if ( function_exists( 'get_smooth_slider' ) ) { get_smooth_slider(); }
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts(array(
    'post__not_in' => $do_not_duplicate,
    'paged' => $paged
    )); }
    if (have_posts()) : while (have_posts()) : the_post(); ?>

    Now the Smooth Slider will appear only on homepage. Let us know if it helps.

    SliderVilla.com Team
    Checkout our premium slider plugins at SliderVilla.com

  3. hunted by a geek
    Member
    Posted 2 years ago #

    I was actually hoping to have the featured post in the Smooth Slider appear only in the slider and not as a post below. I.E I do not want the post to duplicate. As you can see from the code, the theme doesn't duplicate the posts, but when I add in smooth slider, the post do duplicate.

    Thanks :)

  4. slidervilla
    Member
    Plugin Author

    Posted 2 years ago #

    You can easily add featured posts in the Smooth Slider. There are two ways to do so.

    1. Add individual posts to Smooth Slider from the edit window of the post. On edit window, you will see 'Smooth Slider' meta box with an option to "Add the post to Smooth Slider".

    2. Create a category named 'Featured' and add the featured to posts to that category. Now use the category shortcode or template tag of Smooth Slider to embed the slider.
    [smoothcategory catg_slug='social-media']
    where ‘social-media’ (don’t forget the quotes) is the slug of the category from which you wish to pull the posts in reverse chronological order (latest is shown first).

    Checkout the Smooth Slider guide to know more about the same.
    http://guides.slidervilla.com/smooth-slider/

    - SliderVilla Team

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Smooth Slider
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic