• Hey guys.

    I am trying to use this ‘featured-slider’ using jQuery and the jQuery UI-library. Link: https://webdeveloperplus.com/jquery/featured-content-slider-using-jquery-ui/

    I have managed to display the content in the right column, but the main area i getting me stuck.
    ( The slider looks currently like this; https://img535.imageshack.us/img535/802/20100522003304.jpg )

    My code is like this, and as you can see, I need something to increase the ‘fragment-ID’ for each post. The first post is fragment-1, second is fragment-2 etc.

    <?php
     $featuredquery = "
        SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
        AND wpostmeta.meta_key = 'article_level'
        AND wpostmeta.meta_value = 'Hovedsak'
        AND wposts.post_status = 'publish'
        AND wposts.post_type = 'post'
        AND wposts.post_date < NOW()
        ORDER BY wposts.post_date DESC
    	LIMIT 0 , 4
     ";
     $featuredposts = $wpdb->get_results($featuredquery, OBJECT);
    ?>
    <div id="featured">
    	<ul class="ui-tabs-nav">
    		<?php if ($featuredposts): ?>
    			<?php foreach ($featuredposts as $post): ?>
    				<?php setup_postdata($post); ?>
    				<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1">
    					<a href="#fragment-1"><img src="https://fx.itpro.no/img?src=/<?php echo get('artikkelbilde'); ?>&w=80&h=50&zc=1" alt="<?php the_title_attribute(); ?>" />
    					<?php the_title(); ?></a>
    				</li>
    			<?php endforeach; ?>
    		<?php else : ?>
    			Ingen innlegg funnet
    		<?php endif; ?>
    	</ul>
    	<!-- Display the content -->
    	<div id="fragment-1" class="ui-tabs-panel">
    		<img src="https://fx.itpro.no/img?src=/<?php echo get_post_meta($post->ID, 'artikkelbilde', true) ?>&w=410&h=250&zc=1" alt="<?php the_title_attribute(); ?>" />
    		<div class="info">
    			<h2><a href="<?php the_permalink() ?>"><?php the_title();?></a></h2>
    			<p><?php excerpt('18'); ?></p>
    		</div>
    	</div>
    </div>

    – I need to cycle the fragment-ID between 1-4
    – Get the displaying of main content to work properly.

    Hope anyone can help with this.. ??

    Thanks!

  • The topic ‘jQuery UI slider – featured posts’ is closed to new replies.