0

On my registration site I have a CPT called "event". In my "Events" page I list these events and create a "register" link for each one towards the "Registration" page:

$events = new WP_Query( array( 
'post_type' => 'event'
) );
while ( $events->have_posts() ) : $events->the_post();
    ?> <a href='<?php bloginfo("wpurl"); ?>/registration'>register</a> <?php
endwhile;

In my "Registration" page, I want to retrieve the $events->post->ID value corresponding to the event that has been clicked. How to do that?

  • 2
    I guess it would be easier to give an answer if you posted some of your current code examples. – birgire Feb 1 '14 at 21:15
  • I still use the query_vars filter to add x and then get_query_var( 'x' ) to retrieve the value. Do you use the same? – birgire Feb 2 '14 at 13:19
  • 1
    Post your code please. – s_ha_dum Feb 2 '14 at 16:25
  • No problem, I edited my question to include my code. – drake035 Feb 5 '14 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.