[Resolved] Create shortcode with PHP to insert in header (Pods)

Home Forums Support Create shortcode with PHP to insert in header (Pods)

  • This topic has 5 replies, 3 voices, and was last updated 10 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1066684
    Marcus

    Hey guys!

    Trying to create a shortcode that I can use in my Header Element.
    The code seems to work, because it gets the correct data from my PODS field that I’m trying to get with this code:

    -Content removed because of security reasons-

    The URL that get’s outputted is correct. However I would like to have it outputted with an anchor tag below the header and not before the header content 😀

    I suppose I write something wrong in my shortcode, and I would appreciate if someone would point out where the fault is!

    Thanks a lot for the greatest theme and support EVER!
    /Marcus

    #1066918
    Tom
    Lead Developer
    Lead Developer
    #1067106
    Marcus

    Thanks Tom!
    When I’m using the shortcode in the header I’m just getting out a “1” which I assume is the ID of the Pod. (Instead of the expected URL that I got with just pasting the PHP in raw via a hook)

    I guess I need to learn a bit more about Pods… 😀

    #1067496
    David
    Staff
    Customer Support

    Hi there,

    you may want to look at the display() function in PODs as opposed to the field() function.

    Jim True on there support is really good so maybe worth joining there slack channel:

    https://slack.pods.io

    #1067500
    Marcus

    I found a guy who helped me out with some code.

    The issue was, when inserting the shortcode in the header, I displayed the header elements ID instead of the pod.

    Thanks for your help guys!

    #1067524
    David
    Staff
    Customer Support

    Awesome – glad you found the solution.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.