• Hello,

    I am trying to embed the data from a single record into a page. I cannot seem to get a single record to work unless it is clicked from a list. We do not want to use the list feature.

    example have the data from a record loaded into a tab that is on a page for say a vendor.

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author xnau webdesign

    (@xnau)

    The single record shortcode needs to be told which record to show. The link from the list does this by including the ID of the record in the URL, but there are other ways to do this.

    For example, if you wanted the shortcode to always show the same record, you could use a shortcode like this:

    [pdb_single record_id=123]

    The would show record ID 123.

    I don’t know what you have in mind here, but in most cases, you will be choosing which record to show with some php code. You’ll have to figure out how to do that part, but the basic idea is your code includes the record ID in the shortcode and use the do_shortcode() function to invoke the shortcode. For a simple example:

    <?php
    $record = 123; // use your own code to assign the value here
    
    // this shows the record with the record id as assigned to the $record variable
    echo do_shortcode( '[pdb_single record_id=' . $record . ']' );
    ?>
Viewing 1 replies (of 1 total)

The topic ‘Single Record Shortcode’ is closed to new replies.