• JCVillar

    (@jcvillar)


    What would be the proper query to get just the favorited posts in my custom loop?

    I’m building a user-favorites page from scratch using my general blog template so i need not just a link to each post but the full content (title, image, etc) displayed.

    This is the query that i’m using right now with 0 success:

    ———————————————————-

    <?php get_header(); ?>
    <?php $the_query = new WP_Query('meta_key=wpfp_favorites'); ?>
    <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    <article class="item">
        <a href="<?php get_custom_field('link-to-web', TRUE); ?>" class="web" target="_blank"></a>
        <span class="plus"></span>
        <div class="info">
            <p class="title"><?php the_title(); ?></p>
            <p class="go-to-web"><?php get_custom_field('web', TRUE); ?></p>
        </div>
        <?php wpfp_link() ?>
        <figure>
            <img class="lazy" src="<?php bloginfo('template_directory'); ?>/img/bg/blank.png" data-original="<?php echo catch_that_image() ?>" alt="<?php the_title(); ?>"/>
        </figure>
    </article>
    <?php endwhile; ?>
    <?php wp_reset_postdata();?>
    
    <?php get_footer(); ?>

    —————————————————————

    What am i doing wrong?

    Thanks!

    https://wordpress.org/plugins/wp-favorite-posts/

  • The topic ‘Query for custom user-favorites page’ is closed to new replies.