• Hi,

    problem:
    I`ve created some shortcodes which will create their output depending on the post->ID of the current post.

    Is there a chance to fetch the post object for the preview?

    feature request:
    Is there a chance to render your built in shortcodes in editing mode?
    I’m using su_tabs on many sites which should be easy to manage for persons which aren’t fit in any markup language. They will be confused.

    https://wordpress.org/plugins/shortcodes-ultimate/

Viewing 1 replies (of 1 total)
  • In response to your problem:
    I made a custom template for posts that creates a row of four posts next to one another. The shortcode does NOT need to be within its own [su_row], but I recommend putting a [su_divider] on either side of it.
    Here are the four-loop.php template and the necessary styles.
    The intended HTML to get outputted is at the bottom, with a screenshot of how that appears on a live page.

    The shortcode for this on the page is: [su_posts template="templates/four-loop.php" posts_per_page="4" tax_term="36,35,6,1" tax_operator="0" order="desc"]

    It’s important to specify posts_per_page=”4″ or it breaks.

    When I go to Preview when editing a page, this shows up normally with the posts exactly as you see there.

    These are based on auto-imported posts from an RSS feed that become Posts and the loop simply displays the posts horizontally with:

    • Title
    • Meta (minus author)
    • Post Thumbnail note: this will take it directly from the featured image I believe
    • Excerpt

    The intendedoutput.html file is just the HTML from the screenshot as it came out of the loop/SU. I’m not sure if this will work in the Preview for you or not, but it might be that I’m using a Template, or it might be that the code just needs to be tweaked some.

    In response to your feature request:
    This thread relates exactly to what you’re trying to have

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Preview of shortcode one problem, one feature request’ is closed to new replies.