• Hi,

    I want to use this button within a custom_post. I will show attachments of that post only, when clicked. I want to show a shortcode content, which give attached image with that post.

    I have tried putting the shortcodes in the repeating template, it just shows the shortcodesa as text.

    How can I do this ?

    https://ww.wp.xz.cn/plugins/ajax-load-more/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi chakladar,
    So you want to embed ajax load more inside a custom post type?

    You dont put the shortcode in your templates, you place the shortcode on the custom post type page/template.

    Does that make sense?

    Thread Starter chakladar

    (@chakladar)

    Hi,

    I think you have misunderstood it. I have my own shortcode, that generate the attachments image, I have put that shortcode in the repeating template. Not your ajax-load-more shortcode. I have put alm shortcode in the custom post type.

    Plugin Author Darren Cooney

    (@dcooney)

    Can you post your repeater template?

    Thread Starter chakladar

    (@chakladar)

    <php echo do_shortcode('[FILES]'); ?>

    [FILES] is my shortcode, which gives out the attachments in that post. I have used this in repeater template.

    Plugin Author Darren Cooney

    (@dcooney)

    Yea looks like there is an issue with nesting shortcodes in repeaters.

    I’ll try to solve this this week.

    Plugin Author Darren Cooney

    (@dcooney)

    Actually, no is working as expected.

    Your issue is you are missing the ? in your PHP statement.
    Should be: <?php echo do_shortcode('[FILES]'); ?>

    Thread Starter chakladar

    (@chakladar)

    Sorry, it is a typo mistake here only. I have use ? in the repeater template. It is not working.

    Plugin Author Darren Cooney

    (@dcooney)

    I tested on my end and I was able to output my button shortcode.
    <li><?php echo do_shortcode('[button]BUTTON[/button]'); ?></li>

    Can you post your full repeater?

    Thread Starter chakladar

    (@chakladar)

    This is my full template.

    <?php echo do_shortcode(‘[FILES]’); ?>

    Plugin Author Darren Cooney

    (@dcooney)

    Try to add
    <div><?php echo do_shortcode('[FILES]'); ?></div>

    Thread Starter chakladar

    (@chakladar)

    No help, does not work.

    Plugin Author Darren Cooney

    (@dcooney)

    Ok then im not sure. Sorry.

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘How to load a shortcode in a post ?’ is closed to new replies.