[Résolu] I can't display a single custom post on a website using elementor
This support ticket is created Il y a 5 années et 9 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I created a custom post template. I created a new single page for elementor.
Everything works fine when editing the single template in elementor (adding the content block displays the custom post template as I would expect it), but when I try to actually access a single post on the front page, it only shows the header and footer and nothing else.
I would suspect that this is the case. It is because there are incompatibilities with Elementor and Toolset.
So what you need to do when working with Elementor and toolset is to creat the templates using Elementor and then add toolset elements to that elementor template.
Yea, it's the exact case noted under the limitation.
This, however, means I can't use either way of displaying a post properly.
Because if I use the toolset content template, I can't make the rest of the page look ok and just plop the Elementor post content block where I'd want toolset to load its thing. I also need conditional statements which I can't add outside of toolset. I also need to add stuff like `<img src="/wp-content/uploads/sites/26/2019/02/[types field='profile-image'][/types].png">` to name a few.
And if I use shortcode blocks, within the Elementor builder, they also don't display correctly, as the html code they generate is not valid (they leave open tags, and screw up everything being displayed after them.
Toolset has a very PHP-like way of displaying things on the front end which is really useful, but if it isn't compatible with anything (issues with Divi, issues with Elementor) and it seems that everything I try is an exception that is not supported, then what is the point.
I am not trying to do something outrageous here. I am inserting the "page/post content" within a single page template, which is a very basic way to do things. The fact that this does not work is clearly a bug, not a "limitation". This is a premium plugin after all, not some abandoned freeware found in some corner of the WordPress plugins repository, as such I expect it to actually work.
Is there a way to submit a "feature request" or more appropriately a bug report and to track its progress, so I can be notified when it has been addressed?
However I cant see why this doesn't work outside of our views plugin. The format below that you have is still supported under the wordpress API so it should work.
Secondly you made mention that the conditional shortcodes don't work when used in elementor. I'm not aware of any issues where you are bounded to use our conditional shortcode within views.
As long as views is active you should be able to use the conditionals.
Instead of using shortcode blocks what you can do is use the HTML blocks that elementor provides and add the shortcodes to them. This should work just as well.
As you can expect each of these builders are built by different Development teams, each with their own ideas so it wouldn't be strange or unacceptable if there are compatibility issues. The most we can do is address the issues that are on our side such as when divi elements didn't render our shortcodes.
But we cannot expect a full 100% compatibility.
Please let me know if this helps and if there is something specific with Elementor and toolset that you want me to assist with.
Views work amazingly. The issue occurs when I am trying to display a single item.
From what I gather there is no way to create a view that displays one field, which I can then embed onto a single custom post.
There used to be a way to create a view that displays 1 item, then set a filter by ID and select the ID of the page the view is currently shown on.
Now the only thing I can do with ID filtering is to pass the value via shortcode attribute. But using `[wpv-view name="view-name" ids="[wpv-post-id]"]` hasn't worked in a while.
And I do expect full compatibility. I am not asking for full support using some low budget third-party plugin. I have an expectation that two of the leading plugins for WordPress, claiming to be the best at what they do, to be compatible. I agree that compatibility issues may arise, but not with main functionality, such as being able to display the single content template, which is 50% of the functionality of Views.
My problem is the fact that what Toolset sees as a solution is telling customers it is not possible, instead of working on a solution to resolve the problem, and deliver on the product they sold me and my clients on.
"From what I gather there is no way to create a view that displays one field, which I can then embed onto a single custom post."
This is actually not correct. You actually can. To limit the view to display one item you will need to add a query filter for the Post ID to the view. Then set the query filter to filter for the current page ID.
As you mentioned it worked previously but this actually still works. If you could allow me to go through the page that you are having this issue on maybe I can find what is wrong .
Perhaps its the way the questions are posted that would lead a to a "not possible" response. What you can do is to let me know what you want to achieve and provide the credentials to the page where the work has been started so it can be used as an example.
The private fields have been enabled for your next response.
The breaking of the shortcode with the additional "]" at the end is caused by the elementor shortcodes widget.
Secondly, the view should be working now as it is displaying the conditionals correctly for a single post of the persona CPT.
Perhaps i'm still not understanding clearly but i'm under the impressions that you want to use views to display the custom fields of the current page that it is on.
Correct. I want to build a more advanced layout. I know I could do this via a content template, but that requires me to not load elementor at all. Re-coding the grid, etc and manually trying to create the layout in HTML and CSS using views is not practical.
So I need a way to display and conditionally display fields. inside the elementor single persona view.
Also the extra closing bracket is a Toolset bug. I can replicate it on websites not using elementor. it appears whenever I use[wpv-post-id] as a parameter for a shortcode. [wpv-view name="employees-display" ids="[wpv-post-id]"].
using shortcodes in the text editor will sometimes severely mess up html code rendered by the shortcode.
What I found to work was:
1. Add a shortcode block
2. Set the content to dynamic and select post ID. Now the shortcode block displays the post/page id.
3. Click on the settings icon that shows up next to the "ID" field.
4. In the before field type in the first part of the shortcode: