• Resolved Solovoleyplaya

    (@solovoleyplaya)


    This plugin might be what I was looking for.

    The only thing I need now is to display the posts using a template that is located in another folder. Note that I am using a child theme, so I am forced to use a relative path to this child theme.

    For example, I was using …
    [ic_add_posts post_type=’news’ ic_add_posts template=’/wp-content/themes/supreme/page.php’]

    But is doesn’t work, it still uses the default posts_loop_template.php

    Could you please give me some pointers to use a relative path to my template file?

    https://www.ads-software.com/extend/plugins/posts-in-page/

Viewing 1 replies (of 1 total)
  • Plugin Author Eric Amundson

    (@sewmyheadon)

    Howdy Solovoleyplaya,

    Revisit the Using Shortcodes in the WordPress editor section and you’ll see this:

    [ic_add_posts template='template-in-theme-dir.php']

    In case you want to style your markup, add meta data, etc. Each shortcode can reference a different template. These templates must exist in the theme directory.

    So, you’ll want to copy the posts_loop_template.php file into your theme directory and if you wish to rename it, you can. Just make sure that in your shortcode, you add only the name of the template file in your theme (you don’t need the whole path).

    If you have an existing page.php template in your theme, you’ll probably not want to overwrite it as it’ll have a lot more code in it than just our template.

    I hope that helps!
    Eric

Viewing 1 replies (of 1 total)
  • The topic ‘How to use a template that is in another folder’ is closed to new replies.