Home>Support>Use another tempalte for a widget from “SiteOrigin Widgets Bundle”.

Use another tempalte for a widget from “SiteOrigin Widgets Bundle”.

I need to use a different template for the widget “Post Carousel” and “Blog” the SiteOrigin Widgets Bundle.

I managed to bring the content from a Custom Post Type (pods), but now I need to be able to use that new template on the site.

I am using the Corp’s child theme

Greetings

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 months, 6 hours ago Andrew Misplon
    Hi, I Work Here

    Hi Agustín

    Thanks for getting in touch.

    Alex has prepared a PR to allow for a custom template to be added to the Blog Widget. You can keep an eye on the PR for merging here.

    The Carousel Addon in SiteOrigin Premium adds a new Overlay template to the Post Carousel Widget: Page: Carousel.

    I’m not sure whether the Post Carousel has a filter for adding a custom template. I’ll ask Alex to reply.

  2. 6 months, 30 days ago Agustín Donna

    I am trying to use the “PR” but it is not working, does the new file have to be in the same folder (of the widget) or in the child theme?

    I’m waiting if there is any news about the Post Carousel Widget

    Thanks

  3. 6 months, 30 days ago Alex S
    Hi, I Work Here

    Hi Agustín,

    It’s possible to load additional templates for the SiteOrigin Post Carousel widget by using the siteorigin_widgets_template_variables_sow-post-carousel and siteorigin_post_carousel_ajax_item_template filters. The following code will override the template and set it to test.php.

    add_filter( 'siteorigin_widgets_template_variables_sow-post-carousel', function( $template_vars, $instance ) {
    	$template_vars['settings']['item_template'] = get_stylesheet_directory() . 'post-carousel/test.php';
    	return $template_vars;
    }, 10, 2 );
    
    
    add_filter( 'siteorigin_post_carousel_ajax_item_template', function( $template, $instance ) {
    	$template_vars['settings']['item_template'] = get_stylesheet_directory() . 'post-carousel/test.php';
    	return $template;
    }, 10, 2 );

    Kind regards,
    Alex

  4. 6 months, 29 days ago Agustín Donna

    Thank you very much for the answers, but I ran into some problems.

    Regarding the blog function, it doesn’t load the template, I don’t know if the file is misplaced or what it could be.

    Regarding the carrousel function, it works, but it does not load the content, the template I am using is the original one but modified to show other fields. What could be happening?

    Thanks

  5. 6 months, 29 days ago Alex S
    Hi, I Work Here

    Hi Agustín,

    The PR Andrew linked for the Blog widget template replacement is not currently available in the release version so the filter in the linked thread won’t work yet.

    Regarding the Carousel function, if you revert your changes, does it work as expected? If you’ve duplicated the Widget Bundle templates it should work as expected.

    Please note that we can only provide limited assistance here due to the scope of our free support. SiteOrigin Premium includes more comprehensive technical support.

    Kind regards,
    Alex

  6. 6 months, 29 days ago Agustín Donna

    Thank you for your answers.

    Indeed, if I deactivate the function, the content reappears.

  7. 6 months, 28 days ago Alex S
    Hi, I Work Here

    Hi Agustín,

    Sorry, by changes I mean the changes to the copied template. You mentioned you copied the original template and then made changes. Did it work before making changes?

    If it did, that suggests an error was introduced during the modifications.

    If it didn’t work, that suggests an inclusion issue and I recommend checking the path to the file is correct.

    Kind regards,
    Alex

  8. 6 months, 25 days ago Agustín Donna

    First of all, Happy Holidays!

    I tried to use the original file and it still does not load, which leads me to the conclusion that the file location is incorrect.

    Does the function bring the path of the theme child? (I put the function in the function.php thel child theme).

    Thanks

  9. 6 months, 24 days ago Alex S
    Hi, I Work Here

    Hi Agustín,

    You’ll need to provide the absolute path and file name for the template. If you’re adding the template using a theme, you can use get_stylesheet_directory to make this a little easier.

    Kind regards,
    Alex

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More