Post Carousel Widget

Is there any way to put the post carousel in a widget or place with a code in the body of a website instead of above the header?

Hi there,

No, unfortunately, it is not possible to do so as we do not have any kind of shortcode regarding this. It is possible with extensive customization which is outside of our support scope but we will do our best to show you how to do so.

First of all, you will need to nstall the child theme for your website.

Then add a specific Template file for a page which you want to have the posts carousel. For more information:

You can use the code of one of our page templates located in:

wp-content/themes/x/framework/views/ethos/template-blank-1.php

You can use the code of files from 1 to 8.

Now in the page template, you have just added this code wherever you feel is good to add:

<?php x_get_view( 'ethos', '_post', 'carousel' ); ?> 

Hope it helps.

My site is http://muvztoinspire.com, I believe I already have the correct template installed? It’s Ethos. I just currently do not have the post carousel enabled in the Customizer. At this point do I just need to install the child theme and then enable the post carousel and then add the php code you provided on the homepage?

Hello There,

Thanks for updating in! The post carousel is only available in Ethos. Since you are now using Ethos, simply follow the instruction of Christopher so that you can display the post carousel in any page of the page if you wish to.

Please let us know how it goes.

When you add the code you add it to the template.php, whichever template you are using on the page you want the carousel? That just shows the carousel at the top of the page? What about showing it in the middle of the page?

Hi There,

Correct on both statements. Depending on where you add it, it can be on top or bottom of that page content. Showing it in the middle of the page as part of the content means it should be at least in a shortcode which is not available. That workaround adding that code will only work on custom template. Unfortunately as previously stated it is possible with customization that is outside the scope of our support. You may wish to consult a developer to achieve this. Thank you for understanding.

I am a developer I am just trying to better understand what the instructions are and do. Your support use to be a lot better back when I first started using X, I didn’t get all this “it’s outside of our support scope.” Helping developers like me better understand how the X-theme works and what type of customizations and options we have is not outside the support scope. I’m not asking your team to do the work for me, just help me understand how the framework is set up. A developer cannot get better without support. The more I know about the theme the more work I can do and therefore the more theme licenses I buy. One of the main reasons I stick with X-theme is the support, but lately I can’t help to feel let down with the responses that are “go talk to a developer.”

Thank you @christopher.amirian for your answer. I am currently looking at wp-content…/template-blank-1.php. I see where it says get header at the top and ends with get footer. So I completely understand what you mean by adding the get carousel php code where I want it.

Now my only remaining questions are will adding this template to the homepage overwrite (erase my sections) everything I currently have on the homepage or only change the template/layout? And since this only adds a carousel to the page (top or bottom) what do I need to do to try and get it in the middle of the page? @Lely says “the workaround adding that code will only work on custom template.” I don’t understand what that means, I can add a custom template, so does that mean I need to add code to the custom template that states the carousel will be in the middle of the page? Again, I don’t need your team to do the work for me, just please help me understand how I would go about trying to complete this.

Do I need to make my own shortcode? Do I need to add CSS that changes the position of the carousel? Do I need to add PHP in the template that states the position of the carousel?

2 Likes

I added the php get carousel code to blank template 1 and then added the template to the about page muvztoinspire.com/about/. I had to enable the post carousel in order for it to work, which made the post carousel be on every page anyways. So just to have the post carousel on one page I would have to add CSS to hide it on all the other pages?

Hello There,

Thanks for updating in! You can make use of a condition so that the post carousel will only display on a particular page which you have supplied the page id. For example:


<?php if ( is_page('123') ) : ?>

  <?php x_get_view( 'ethos', '_post', 'carousel' ); ?>

<?php endif; ?>

You won’t be needing a css to hide the post carousel because it will only be displayed on page bearing the page ID 123. To get the page ID, please check out this knowledge base article: https://theme.co/apex/forum/t/setup-how-to-locate-post-ids/59

Please let us know if this works out for you.

This does work in order to get a carousel on the top of a page, thank you.

I decided instead to re-create a carousel using a slider and this way I can add a shortcode to the middle of the page.

Hey @vmars9,

We are just glad that you have figured it out a way to correct the said issue.
Thanks for letting us know!

All the best.