• Resolved jess8bit

    (@jess8bit)


    Hello,

    great plugin! I’m using it to skin Custom Post Types in the Posts Widget from Elementor Pro.

    The following may sound like a newbie question, sorry about that.

    I just want to display the current post position in the loop, in the skin template.

    I guess this cannot be achieved without some piece of code, which is not a problem, but I can’t figure out how to achieve this. And there are probably many ways to do so.

    My understanding so far is that current post position can be retrieved from the global WP_Query object like this:

    global $wp_query;
    $curr_post_position = $wp_query->current_post;

    But,
    1) I am in the context of a Custom Query (since I use Posts Widget to display a filtered archive of CPTs. So how to reach that custom query object from within each post (skin) template? A code snippet?
    2) Where to place the code otherwise? (that’s where I sound like a newbie I guess 🙂 )
    3) Can we do something with the Custom Query ID provided by the Posts Widget in order to achieve this somehow?

    If anyone could push me towards the right direction here, I would appreciate a lot!

    thanks,
    J

The topic ‘Display Current Post Position’ is closed to new replies.