WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] AstickyPostOrder + featured categories = failure (5 posts)

  1. do77
    Member
    Posted 5 years ago #

    Hey,
    I am using the revolution lifestyle theme and I also want to use the AstickyPostorder plugin. But when I activate the plugin, the sections on the homepage don't show the featured posts anymore.

    Does anyone has an idea why that could be?

    Thanks!

  2. do77
    Member
    Posted 5 years ago #

    Ok, I figured it out. I had to define the featured posts by ID to make the plugin work with the theme.

  3. Riavon
    Member
    Posted 5 years ago #

    Can you explain? I don't understand what you mean by 'define the featured posts by ID' ? I am having this same issue with this plugin and the Streamlined theme. Any insight or more detailed help to get this plugin to work with this theme I'd be most grateful!

  4. pou7777
    Member
    Posted 4 years ago #

    Instead of having this in your header.php :
    <?php $my_query = new WP_Query('category_name=featured&showposts=10');?>

    you must build a query with the ID instead of category_name and it should look like this:

    <?php
    $args = array(
          	'showposts' => 10,
          	'post__in'  => array(1,3,66,321)
          );
    $my_query = new WP_Query($args); ?>

    where 1,3,66,321 are posts ID.

  5. astro604
    Member
    Posted 4 years ago #

    Can someone please help with what I need to adjust the following code to make the featured categories show the posts on the home page. I'm not sure what need to change.

    This is part of the code that is on my home.php page using the studiopress lifestyle theme:

    <div class="hpfeatured">
    			<h3><?php echo cat_id_to_name(get_theme_mod('featured_top_right')); ?></h3>
    
    				<?php $recent = new WP_Query("cat=".get_theme_mod('featured_top_right')."&showposts=".get_theme_mod('featured_top_right_num')); while($recent->have_posts()) : $recent->the_post();?>
    				<?php if( get_post_meta($post->ID, "thumb", true) ): ?>
    				<a href="<?php the_permalink() ?>" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=<?php echo get_theme_mod('featured_top_right_thumb_height'); ?>&w=<?php echo get_theme_mod('featured_top_right_thumb_width'); ?>&zc=1" alt="<?php the_title(); ?>" /></a>
    				<?php else: ?>
    				<?php endif; ?>		
    
    				<strong><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></strong>
    				<?php the_content_limit(80, ""); ?>
    
    				<hr/>
    
    				<?php endwhile; ?>
    				<?php $cat = get_category(get_theme_mod('featured_top_right')); ?>
    				<strong><a href="<?php echo get_category_link(get_theme_mod('featured_top_right')); ?>" rel="bookmark"><?php echo __("Read More Posts From ", 'studiopress')." ".$cat->name; ?></a></strong>
    
    			</div>

Topic Closed

This topic has been closed to new replies.

About this Topic