• 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter jess8bit

    (@jess8bit)

    Is this something that could be more easily solved with the ECS Pro version?

    Like, if I add {{current_version}} somewhere in my loop skin ?

    J.

    Plugin Author dudaster

    (@dudaster)

    It should be easy with ECS Pro. I’ll be back with a solution…

    Thread Starter jess8bit

    (@jess8bit)

    Hey @dudaster, thanks for reaching out.

    So, since yesterday I now have an ECS Pro license (one of the last available from the 100 you proposed) 🙂

    I tried to add keywords like {{current_position}} and {{post_title}} in the body of a Text widget inside the loop skin for my CPT but it does not get replaced as I expected. I might be missusing this though (would need guidelines for dummies I guess).

    also it’s an 1.0.0 ECS pro (just saw an incoming 1.1.0 – not tested yet)

    Looking fwd to hearing from you later.
    I stay tuned,

    keep up the good work!
    thanks

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I removed ECS pro plugin

    For pro or commercial product support please contact the author directly on their site. This includes any pre-sales topics as well.

    As the author is aware, commercial products are not supported in these forums. I am sure they will have no problem supporting you there.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @dudaster Do not support your customers in these forums. That’s not allowed and all pro topics will be closed and the replies will be archived as I have done in this topic.

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

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