Ben @ Team Tangible
Forum Replies Created
-
Forum: Plugins
In reply to: [Loops & Logic] Translated media url not showing in loopHi again @douglasmikado, I just installed Polylang on a test site and enabled media translations and it seems that adding
<Field image_url />
to a template located within a post that contains a featured image correctly displays the featured image URL in both translations of the post. So it seems this isn’t an issue with L&L or Polylang but likely either a conflict with another plugin on your site or a syntax issue with your template. I just took another look at the markup you mentioned writing in your template:<div class=”tangible-bg-img”style=”background-image: url({Field image_url})”</div> <Field image />
If this is the exact markup you added to your template, then I think this is probably the issue. I can see directional quotation marks like
”
when only straight quotation marks like"
are valid characters in HTML syntax (and therefore L&L syntax too). I also noticed you don’t have spaces between your attributes, which is again an invalid HTML syntax. Could you try adding an L&L template to a translated post in both languages that only includes<Field image_url />
with no other markup and let me know if that currently displays the featured image URL in both languages?If that doesn’t solve it, you might want to try deactivating other plugins to determine if another plugin installed on your site might be causing this issue, since it doesn’t seem to exist for me with a fresh install that only includes L&L and Polylang.
Forum: Plugins
In reply to: [Loops & Logic] Blog post: Reading TimeHi @nermel, this greatly depends on how you’ve set up your site. If you have a custom field on each post called
reading_time
and that field contains data about the amount of time it would take to read a post, then yes,<Field reading_time />
would be the way to display that field’s data. However, “reading time” is not a default field in WordPress so I assume that on that site you linked, some other plugin is being used to generate the data about reading time. If that data is saved to a post field, then it could be accessed by L&L’sField
tag. There are lots of reading time plugins available in the WordPress plugin repo so you’d need to reach out to their developers to find out if that data is being saved to a field and if so, what it’s called. One convenient way to see all the field names available on any post type is by adding<Field all />
to your template, which displays all the available fields you could display.My assumption though is that in the example site you shared, that reading time data is simply being generated with PHP based on the post’s length and then displayed on the front end of the theme without creating or modifying any kind of post field. If that’s the case, then there would be no way for L&L to “see” the data and display it since it doesn’t actually exist in the database.
So long story short, if the field exists on a post, you’re on the right track and you should be able to display it with
<Field your_field_name />
. But if that data doesn’t exist in a field, then unfortunately that’s not something that L&L will be able to display. In the future, there might be more tools built into L&L that would allow you to dynamically check the length of a post and dynamically generate the reading time number all within L&L, but that’s not currently possible with the dynamic tags built into L&L.Forum: Plugins
In reply to: [Loops & Logic] Translated media url not showing in loopInteresting. I think we’d need to take a look at the site in order to identify whether this is an issue with L&L or Polylang, so a staging instance would be helpful. We use L&L with WPML on our multilingual sites and that generally works great so my hunch is that this is a Polylang issue but we’d need to check to make sure.
Forum: Plugins
In reply to: [Loops & Logic] Bug: Plugin is clearing widget contentHi again @besimk, it’s been a long time coming but I’m happy to report that the latest 3.0.0 release of the plugin includes a fix to this customizer widget issue you identified.
Forum: Plugins
In reply to: [Loops & Logic] Field “content” stripping “p”Thanks for the clarification, I just saw that thread you made on the Tangible forum. Let’s stick to that one since the Tangible team tends to monitor that forum a bit more closely than this WordPress forum. We can update this thread when the issue has been resolved.
Forum: Plugins
In reply to: [Loops & Logic] Field “content” stripping “p”Hi @polarracing, could you clarify where/how this is happening? I just tested creating a simple post with both regular WordPress paragraphs and manual inline paragraphs using
<p>
in L&L versions 2.4.4 and version 3.0.0 and in both cases, the paragraphs remained intact when using<Field content />
. Could you share the template you’re using to display this content as well as some information about what data is contained in the field you’re trying to display and what the expected vs actual output is? That’ll help us to replicate your issue so that we can troubleshoot this.Forum: Plugins
In reply to: [Loops & Logic] CPT with category not showingHi @sdacreative, it looks like this thread has been sitting for a while and we haven’t heard back from you so I’m going to mark it as resolved. If you’re still having issues, feel free to update the status of this thread and let me know what you discovered about the issue during your testing of the suggestions I made above. Don’t hesitate to reach back out about this or any other issues!
Forum: Plugins
In reply to: [Loops & Logic] Shortcode creating error in template editorHey @polarracing, I just ran a quick test with a simple shortcode in the latest version of L&L and I’m not seeing any errors using the standard syntax you’re using here. I wonder if this is specific to the shortcode you’re using. Could you confirm that this shortcode is working correctly on its own (using the standard WP shortcode syntax on a page instead of using L&L)? Could you also provide more information about what shortcode you’re using?
Forum: Plugins
In reply to: [Loops & Logic] Translated media url not showing in loopInteresting. If I understand correctly, you’re using L&L to display both the text fields and the featured image field on both the English and Dutch versions of the page. Is that right? I would assume that if other fields are showing correctly and it’s simply the image field that isn’t, this might be an issue with the way your multilingual setup works, but it’s hard to know for sure without seeing what’s going on there. Are you using a plugin for that and if so, which one? You could try using
<Field all />
on your Dutch template to see if the featured image still exists or if it happens to use a different field name in the translated version of the page.Maybe the easiest way to resolve this would be to give us access to your site if you’re willing by sending us some credentials to your site here with some information about which page is causing the issue and we’ll take a look.
Forum: Plugins
In reply to: [Loops & Logic] CPT with category not showingHmm, that’s odd. When I try your markup on my site, it works as expected. Could you describe in a bit more detail what your data structure is, what you expect that your markup should output, and what it’s actually outputting?
Here are a few suggestions to try to troubleshoot this:
- Check that
project
is the actual slug for your CPT and that it’s spelled correctly - Check that you have project posts that have the
featured
category applied to them - Try removing count=-1. It shouldn’t hurt anything here but omitting the count attribute displays all results by default so it isn’t necessary in your case
- Try removing the
category
parameter to check whether your loop is displaying project posts as expected - If you have other categories applied to your posts, try using a different category name in the
category
attribute to see if this is only an issue with yourfeatured
category or if it affects other categories too
Let me know what you discover while you’re testing!
Forum: Plugins
In reply to: [Loops & Logic] Loop is all over the place – need help!I’m not sure I quite understand what you mean when you say that it seems to “ render every repeater as the next post date.” Could you clarify what the expected output of your markup should be (maybe shed a bit of light on your data structure) and what the actual output is?
Forum: Plugins
In reply to: [Loops & Logic] Taxonomy Term OrderYou’ll notice in the documentation for the taxonomy term loop that the
orderby
query parameter is the one that’s used to set the order in which terms should be displayed and by default (i.e. if it’s not specified), it’s set totitle
. So presumably your taxonomy terms are currently being displayed alphabetically. Does adding the query parameterorderby=menu_order
give you the order you’re looking for?By the way, I thought I’d mention that you might find the Loops & Logic forum to be a better place to get product support in the future. It’s a much more active community than this support in the WordPress plugin repository and there are people with a broader range of skillsets that can help you out with all sorts of things. Hope to see you on the forum!
Forum: Plugins
In reply to: [Loops & Logic] If statements are always falseHi Andrew, glad to hear you’re finding good uses for L&L! You’re right that its flexibility means that it’s able to replace a lot of other single-purpose plugins.
I think your issue here is that you’re getting mixed up between the syntax of different tags since not all tags accept the same attributes. For the
If
tag, there are specific core conditions that you can use as a subject andacf_editor="..."
isn’t one of them. In your case, since you’re wanting to write some conditional logic when a particular field exists, you’ll probably want to use thefield
attribute as the subject, like this:<If field=propsum_total_units exists>
. I think that should solve your problem, but if not, don’t hesitate to follow up here.By the way, I thought I’d mention that you might find the Loops & Logic forum to be a better place to get product support in the future. It’s a much more active community than this support in the WordPress plugin repository and there are people with a broader range of skillsets that can help you out with all sorts of things. Hope to see you on the forum!
Forum: Plugins
In reply to: [Loops & Logic] Filter ACF Relationship Field By TaxonomyThat’s a really good question and isn’t something that’s particularly clear in the current documentation. To answer your question, the curly braces are supposed to be there and that’s (probably) the exact syntax you’d want to use. I’m in the process of rebuilding the docs as we speak to make that syntax clear, but for now, you can see it explained in this blog post. If you’re unclear on the correct syntax for L&L, that whole blog post might be a good read, but the short explanation is that whenever you’re writing a tag within an attribute value, you change <angle brackets> to {curly braces}. That’s always the case whether you’re just using one tag or a whole bunch of them.
Let me know if you have any other questions about this!
Forum: Plugins
In reply to: [Loops & Logic] Filter ACF Relationship Field By TaxonomyAh okay, that makes sense! I actually made a mistake in my previous code example (I was trying a couple of things and ended up mashing two ideas together) but I think one solution you should try is filtering your loop using the post loop’s query parameters. So you’d use the
taxonomy
query parameter to only loop through posts that have that taxonomy applied and then theterms
parameter to further filter your loop to only posts that have your taxonomy term “active” applied to them. So something like this:<Loop acf_relationship=client_projects taxonomy=stage terms=active>
That being said, while this solution would definitely work for a regular post loop (i.e.
<Loop type=post>
), I’m actually not certain if the acf_relationship loop accepts the same query parameters as the regular post loop. If it doesn’t, then your first hypothesis about needing to nest some conditional logic inside your loop might actually be the right option here. If that’s the case, you’ll want to read up on what core conditions the If tag accepts and make sure your conditional logic fits that format. Something like this might work:<Loop acf_relationship=client_projects> <If check="{Taxonomy stage}{Term title}{/Taxonomy}" value=active> <div class="row"> <div class="col-1"><Field acf_editor=project_pid /></div> <div class="col-4"><Field acf_editor=project_name /></div> <div class="col-2"><Taxonomy stage><Term title /></Taxonomy></div> <div class="col-1"><Field acf_editor=project_start /></div> <div class="col-1"><Field acf_editor=project_target /></div> <div class="col-3"><Field acf_editor=project_next_step /></div> </div> </If> </Loop>
I’m pretty certain that the second option here should work for you, but definitely give the first option a try since if the acf_relationship loop accepts regular post loop query parameters, that’d be more efficient. Note that this second option I’ve suggested would only work as-is if you only set one stage term per post, but I assume that’s the case in your example. Let me know which of these ends up working for you! If the second option ends up working for you, you could test whether it might be more efficient to
Set
a variable for your Term title before your conditional statement and thenGet
that variable both inside your If statement and inside your thirddiv
.Hope those ideas are enough to get this working for you, let me know if you have any other questions!
- Check that