Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi guys;

    the above code inside the wpfp-page-template.php outputs the favs of the current user, with post-type issues that you probably solved.

    I’m trying to query most favorited of custom type ‘idea’ on archive-ibest.php .

    here’s the code of archive-ibest.php :

    <?php
        $custom_query = new WP_Query(array(
            'post_type' => 'idea',
            'meta_key' => 'wpfp_favorites',
            'orderby' => 'meta_value',
    
    		));
    
    ?>
    <?php if (have_posts()): ?>
    <?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
    
    			<!-- Content Template -->
                                                    <?php include (TEMPLATEPATH . '/CONTENTS/idea.php'); ?>
    			<!-- Content Template -->
    
    						<?php endwhile; ?>
    						<?php wp_reset_postdata(); ?>
    						<?php endif; ?>

    just nothing appears as results.

    I would be grateful for any help. I’ve also created a thread for this but nothing yet. here it goes :

    wordpress.org/support/topic/querying-top-posts-of-a-custom-post-type?replies=3

    Thread Starter Ata JBZ

    (@ata-jbz)

    I’m trying to query most favorited of custom type ‘idea’ on archive-ibest.php .

    here’s the code of archive-ibest.php :

    <?php
        $custom_query = new WP_Query(array(
            'post_type' => 'idea',
            'meta_key' => 'wpfp_favorites',
            'orderby' => 'meta_value',
    
    		));
    
    ?>
    <?php if (have_posts()): ?>
    <?php while ($custom_query->have_posts()) : $custom_query->the_post(); ?>
    
    			<!-- Content Template -->
                                                    <?php include (TEMPLATEPATH . '/CONTENTS/idea.php'); ?>
    			<!-- Content Template -->
    
    						<?php endwhile; ?>
    						<?php wp_reset_postdata(); ?>
    						<?php endif; ?>

    help!

    Thread Starter Ata JBZ

    (@ata-jbz)

    Is this the right approach?

Viewing 3 replies - 1 through 3 (of 3 total)