Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kyle Phillips

    (@kylephillips)

    If I understand your question correctly, you can use the get_user_favorites function to fetch the current user’s favorites. It returns an array of post IDs they have favorited.

    Thread Starter freedumbo

    (@freedumbo)

    Could you show me in detail??
    I try like this.

    <?php while ( have_posts() ) : the_post(); ?>
    <?php echo get_user_favorites($user_id, $site_id); ?>
    <?php endwhile; ?>

    <?php echo get_user_favorites(); ?> …how to use it??
    I just want to print 13457284…like this ‘post id’

    Thread Starter freedumbo

    (@freedumbo)

    When I just use <?php echo get_user_favorites($user_id, $site_id); ?>,
    I only get “array” value.

    Thread Starter freedumbo

    (@freedumbo)

    I’ve done.
    It only worked in method 2

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to get post id in template??’ is closed to new replies.