Tell us what you are trying to do?
I am trying to create a Content Template with a View to display a vertical list of banner images in the footer of a website. The source of the banner images is data from a custom post type called Banners.
I have managed to cobble something together by trial and error but I am stuck on two things:
1. How I can filter the query so that only posts with the custom taxonomy ‘home page’ ticked are shown?
2. How can I get the banners aligned centrally on the page? I’ve already set align to centre in an advanced tab.
Here’s the general idea of what I’m trying to do:
The display needs to show a vertical list of hyperlinked images. Each image is being created from custom field data. The banner image is either:
1. A single image added to a custom field called ‘banner image’ combined with the URL from a custom field called ‘Banner URL’ or….
2. Code added to a custom field called ‘banner code’.
If an advertiser provides code for a banner then the banner image and banner URL fields will not have data added to them.
The Banners custom post type has two custom taxonomies assigned, Home Page and Links Page. These are to determine where the banners will be displayed.
I want to create a view to show on the home page that shows all banners with the taxonomy ‘Home Page’ selected and order them by ‘Priority’ which is a Banners custom field (number) and ordered high to low so that a banner with a priority of 10 will show in the list before a banner with a priority of 2 for example.
I’ve set the custom fields in Banners as follows:
Banner URL
Banner Image
Banner Code
Banner Alt Text
Banner Priority
As mentioned before the custom Taxonomies for banners are:
Home Page (to be displayed in a custom footer created using Elementor that is already working)
Links Page (this page is not created yet)
I’ve created the Toolset Content Template called Banners - Home Page and within it created a View. I can’t remember what the view was called but ‘Views’ is not in my list of Toolset plugins that I can install and therefore it’s not listed in the Toolset menu. I therefore cannot delete any older failed test views I created and I am forced to see these in a list when I am adding a Toolset View from within Elementor. It’s very frustrating.
Anyway, I have added 3 banner posts and assigned the taxonomy ‘Home Page’ to all of them. One with only banner code and 2 with an image and a URL.
I have added a Single Field block in the view firstly for Banner Code and the only banner with code shows and is perfectly centred on the home page in the footer. This is the ‘Punternet’ banner you see.
I then added another single field block and selected Post Source: Current Banner, Source: Banners Field Group, Field: Banner Image. I can only see one of the image based banner post entries on the edit screen (screenshot attached) with the code based Punternet banner below it, but after saving I can see both the red and blue test banner images and the Punternet banner on the home page in the footer.
In the edit page, the Punternet banner is aligned left and the image based banner perfectly centred. On the Home page this is reversed. Both blocks are set to align centre in the advanced tab though.
I am finding the Content Template edit page unbearable. Nothing seems to work or appear as I think it should do. I can only see what the results are by adding the view to a page and viewing it there. I’m very unhappy with how this is. I’m spending days doing something that should take a few minutes.
So, I have been able to get the images displayed, whether there is a code based image or a physical banner image. That’s great. What I can’t do is align the image based banners to the centre of the container even though in the advanced tab I’ve set the align setting to centre. Nor can I set a query to only display banner posts that have the ‘home page’ taxonomy ticked.
Can you please help me. I will add log in details when a private window is offered in this support ticket.
Many thanks,
Barry.
Is there any documentation that you are following? No
Is there a similar example that we can see? No
What is the link to your site? Please scroll down to the footer and look at the three banner images there. lien caché