can't find list
-
hi
where should i paste this code to see list?
[ Moderator note: Please use the code button when posting code. ]<!------ CODE -------> $favorites = get_user_favorites(); if ( $favorites ) : // This is important: if an empty array is passed into the WP_Query parameters, all posts will be returned $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; // If you want to include pagination $favorites_query = new WP_Query(array( 'post_type' => 'post', // If you have multiple post types, pass an array 'posts_per_page' => -1, 'ignore_sticky_posts' => true, 'post__in' => $favorites, 'paged' => $paged // If you want to include pagination, and have a specific posts_per_page set )); if ( $favorites_query->have_posts() ) : while ( $favorites_query->have_posts() ) : $favorites_query->the_post(); echo get_the_title(); endwhile; next_posts_link( 'Older Favorites', $favorites_query->max_num_pages ); previous_posts_link( 'Newer Favorites' ); endif; wp_reset_postdata(); else : echo "Please select an item for favorite post list"; endif;
- The topic ‘can't find list’ is closed to new replies.