Support » Developing with WordPress » Selective Content based on parameters

  • mtankle


    I’m trying to pass a parameter (i.e method=view or method=edit) from an archive page. I tried code like this:

    <a <?php echo('href="'.get_the_permalink(get_the_ID().'?method=view')).'"';?> ><span class="fa fa-eye"></a>

    <a <?php echo('href="'.get_the_permalink(get_the_ID().'?method=edit')).'"';?> ><span class="fa fa-edit"></a>

    In my content.php I want to display a read-only table or render a Caldera Form for editing

    $method = get_query_var( method );
    if ( $method == 'edit') { ?>
    	//display form
    <?php } else { ?>
            // display read only table
    <?php } ?>

    $method is coming up as an empty string. Could someone either point me towards and example or provide one here to accomplish this task? Thank you.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Selective Content based on parameters’ is closed to new replies.