• Resolved jordiwordpress

    (@jordiwordpress)


    I have created a user pod extension and a template, so each user has their own private website. I would like the user, once logged in, to have access to their private website. I have tried to do it with a shortcode from a page linked from a navigation menu.

    With this shortcode display the template with no user information (obviously), but if where=”id = {@user.id} is included display “Pods embed error: Please provide a Pod name”

    [pods template="Usuarios" [/pods]

    With this shortcode display “Pods embed error: Pod not found”

    [pods name=”user” template="Usuarios" where=”id = {@user.id}][/pods]

    Can this be done with a shortcode?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Capitalize ID and user.ID

    Plugin Support Paul Clark

    (@pdclark)

    And name=”user” needs to be dumb straight quotes not curly smart quotes.

    Plugin Support Paul Clark

    (@pdclark)

    And in your where attribute, it also needs to be dumb quotes and you are missing the closing quote before ]

    Plugin Support Paul Clark

    (@pdclark)

    So your complete shortcode would be:

    [pods name="user" template="Usuarios" where="ID = {@user.ID}"][/pods]

    And in order to use {@user.ID} in a WHERE query, define( 'PODS_SHORTCODE_ALLOW_EVALUATE_TAGS', true ); will need to be added to wp-config.php

    So in summary:

    • is not the same character as ". In almost all cases, computer languages use the second version. The first is a typographic character with a curve.
    • id is not the same as ID. The WordPress database schema almost always uses ID unless it is a longer word, like post_id. See the WordPress Database Schema.
    • Just like in HTML, opening and closing quotes and brackets need to be matched. Every opening " must have a closing " and every opening [ must have a closing ].
    • This reply was modified 11 months, 3 weeks ago by Paul Clark.
    Thread Starter jordiwordpress

    (@jordiwordpress)

    perfect, thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcode for a User template’ is closed to new replies.