• Resolved burna

    (@burna)


    Hy!

    I’m putting different slideshows in my header with grabbing the ID from the slideshow manually and insert it in a custom field for every page.

    Then in the header.php i’m grabbing the custom field value (bildergalerie) and want display the slideshow –> code below.

    But it’s a lucky strike, the slideshows are randomly changing!
    If i echo out the current meta field, its the correct one!
    It only effects when i do the “do_action” or “do_shortcode” in a .php file. When i’m inserting the slideshow directly via the button in a page it works!

    Any hints?

    Kind regards,
    Bernhard

    <?
      $slideshow = get_post_meta($post->ID, "bildergalerie", true);
      if ($slideshow) :
        do_action('slideshow_deploy', '$slideshow');
      else :
        // show anything else instead
    ?>

    https://www.ads-software.com/plugins/slideshow-jquery-image-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Stefan Boonstra

    (@stefanboonstra)

    Hi Bernhard,

    The quotation marks around the “$slideshow” variable probably cause the variable to be interpreted as text instead of a variable with a numeric value.

    Try this:

    <?
      $slideshow = get_post_meta($post->ID, "bildergalerie", true);
      if ($slideshow) :
        do_action('slideshow_deploy', $slideshow);
      else :
        // show anything else instead
    ?>
    Thread Starter burna

    (@burna)

    Hy Stefan,

    yap, that was the cause! I was already a bit confused, rookie mistake, hmpf!

    Thank you!

    Kind regards,
    Bernhard

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘do_action with ID from custom field fails in random deploy’ is closed to new replies.