Eliot Akira
Forum Replies Created
-
Hello – It was a bit tricky to figure out, but the following should create a comma-separated list like you described.
<Taxonomy category> <If count more_than value=1><If last> and </If></If> <a href="{Term url}"><Term title /></a><If not last>, </If> </Taxonomy>
It uses
If last
andIf not last
to show,
andand
.Also, it uses
If count
to make sure it doesn’t displayand
when there’s only one term.Similarly for the checkbox field, replacing
Taxonomy
withLoop
, andTerm
withField
.<Loop acf_checkbox=field_name> <If count more_than value=1><If last> and </If></If> <a href="{Field url}"><Field title /></a><If not last>, </If> </Loop>
This assumes you’re using Advanced Custom Fields for the checkbox field. Otherwise, it might work with
Loop field=field_name
, but it depends on how the data is saved by the plugin that provides the custom field.If you have any further questions, please feel free to visit the discussion forum.
Forum: Plugins
In reply to: [Loops & Logic] Replace ‘Custom Content Shortcode’ with thisYes, Loops & Logic is able to do everything that CCS did and more.
Your shortcode can be written as a template like this.
Nummer <Field title /> Konstn?r <Taxonomy portfolio-category /> Teknik <If check="{Taxonomy teknik}"> <Taxonomy teknik /> <Else /> — </If> Material <If check="{Taxonomy material}"> <Taxonomy material /> <Else /> — </If>
The syntax is similar, but with some small differences.
The above template can be saved as a template post, and loaded with a shortcode like
[template name=example]
.For further details, please feel free to join the discussion forum.
Forum: Plugins
In reply to: [Widgets for Google Reviews] Widget Shortcode is Showing@devoantor This is an issue in WP 6.2.1 that affects shortcodes in block themes.
Forum: Plugins
In reply to: [Loops & Logic] does it work with DIVI?Hello – The plugin provides a
template
shortcode, which can embed Loops & Logic templates anywhere that can run a shortcode – including Divi’s Text module and Code module.Forum: Plugins
In reply to: [Loops & Logic] template shortcode not showing on mobileHello, so far I haven’t been able to recreate the issue on my end using Elementor, Tangible Template widget, and a mobile device running Android and Firefox. The content is showing as it is in a desktop browser.
But the newest version 3.2.1 of the L&L plugin does include an improvement in how the Template widget integrates with Elementor – specifically with the builder preview, but it may have something to do with this issue. Could you try and see if it’s solved in this version?
If not, it sounds like there could be some section or element setting related to responsive layout or mobile devices, such as Visibility Controls, Hide/Show Conditions, or Responsive -> Hide on Mobile.
Forum: Plugins
In reply to: [Loops & Logic] Capitalized Loop etc. change into Lower CaseThe site itself is 14 years old
Impressive! It’s probably why that site option was available.
Is there a way I can support the development?
Aside from issue reports like these, which are helpful in improving the plugin – it’d be great if you could spread the word and let people know about the plugin. We’re always looking for community engagement and discussion in the Discourse forum for L&L, and would love to have people participate in our beta testing program for L&L Pro and Tangible Blocks, which is based on the same template system.
I saw the nice review you’d written recently, much appreciated.
Forum: Plugins
In reply to: [Loops & Logic] Capitalized Loop etc. change into Lower CaseWow, I’d never heard of this site option. I don’t see it on my local site under Settings -> Writing, and looking in the code of WordPress itself, the option is only shown if the database was initially older than some version. Same with option “use smilies”.
It’s a really old site option added in WP 0.71 (!), and all the references I can find in the WP issue tracker are more than 10 years old. The oldest issue being 18 years old, where Matt himself fixed it: “WordPress should correct invalidly nested XHTML automatically” feature messes with posting code.
..OK, I tracked down the exact Git commit when this site option was removed: Commit 231c737, “On the Writing Options screen, hide the Balance Tags and Convert Smilies options on new installs.”. This was in 2015, about 8 years ago.
So I think you just ran into this obscure little thing that messes with the HTML. If you could please keep that option off, can we consider this resolved? (EDIT: Oh I see you’ve marked it resolved. Thanks!)
Forum: Plugins
In reply to: [Loops & Logic] Capitalized Loop etc. change into Lower CaseHi @gauravtiwari – Thanks for reporting the issue.
Set up a new site on the same host and configuration the error didn’t show there. Somehow the issue is only with https://gauravtiwari.org and not on my other sites.
That’s weird that it’s only happening on this specific site, how the issue is still there when you disable all plugins, but you’re not seeing it on a fresh new site.
It might have something to do with user roles. Admin users are supposed to be able to edit any HTML, including L&L templates, but other user roles have restrictions like what HTML tags are allowed, or no HTML at all. Maybe there’s a custom user role or permission that forces template HTML to be processed so that all tags become lowercase. But, looking through your list of plugins, I don’t see what could be doing that – and in any case, the issue is still there with all plugins disabled. Hmm..
Another possibility: in your
wp-config.php
, do you have the constantDISALLOW_UNFILTERED_HTML
set to true? That affects admin users too, apparently, and it could be applying some filter to the template content.Forum: Plugins
In reply to: [Loops & Logic] Block Editor StylesThank you for reporting the issue, @gauravtiwari, and thanks @bentangible for narrowing it down to the List block in the editor.
This was an unintended side effect of a workaround that was added in 3.1.3, which addresses a bug in the full-site editor (block stylesheet file not getting loaded unless it contains
.wp-block
class). It was addingdisplay: block
to that class as a dummy style (it wouldn’t work with empty style) – but that interfered with the styling of the List block. Changing it toposition: relative
did the trick – the workaround still works, and it doesn’t affect any block styling in the editor.Long story short, it should be solved in L&L version 3.1.4 released just now.
Forum: Plugins
In reply to: [Loops & Logic] Looping of Custom Post Type not workingOK, so it sounds like the L&L code snippet is actually running – it should work anywhere that the template editor is.
Another angle we can try, to check if the post status is normal. Could you try putting the following in functions.php?
add_action('wp', function() { $posts = get_posts([ 'post_type' => 'jobs', 'numberposts' => 1 ]); tangible()->see( $posts ); }, 0, 99);
That should display a single post from the “jobs” post type. If it’s empty, it probably means something special is necessary to get the posts. If it shows a post, we can check its property called
post_status
to see if it’s “publish” or something custom.Forum: Plugins
In reply to: [Loops & Logic] Looping of Custom Post Type not workingThanks for posting the result – all post type settings seem to be normal, including user capability.
Just in case – is your L&L code snippet in the post content like the shortcode, or is it in the Template post type?
Unlike shortcodes, L&L tags only work in the latter context – so you have to create a template, then load it into the post content with a
[template]
shortcode (as described in this article, Displaying an L&L template).- This reply was modified 2 years, 2 months ago by Eliot Akira.
Forum: Plugins
In reply to: [Loops & Logic] Looping of Custom Post Type not workingHmm, that is mysterious. The CCS and L&L code look the same, and should be working the same too.
If the CCS loop is working, it means the post type’s name “jobs” is correct.
I wonder, maybe the post type uses some special post status other than normal ones like publish/draft? You could try
Loop type=jobs status=all
and see if anything shows.—
It could be that the post type is created with a specific setting passed to register_post_type, that somehow makes it behave differently, where L&L cannot find it. For example, maybe “publicly_queryable” is set to false.
To try to debug it, you can try this code snippet in your theme’s functions.php.
add_action( 'wp', function () { $types = get_post_types([ 'name' => 'jobs' ], 'objects'); tangible()->see( $types ); }, 0, 99 );
(Edit: This snippet requires L&L to be active.)
That should display the “jobs” post type and its settings – in particular, I’m curious if it has “public” and “publicly_queryable” both set to TRUE.
- This reply was modified 2 years, 2 months ago by Eliot Akira.
Forum: Plugins
In reply to: [Loops & Logic] ‘styles_compiled’ meta not updated on import overwriteHello, thank you for the issue report.
That does sound like a bug, the import action is not updating the
styles_compiled
field when there’s an existing template.OK, I’ll comment back here when it’s solved. The next plugin version should be released in the next week or so.
In the meantime, I suppose a workaround is to edit each overwritten template and save it to refresh the styles field.
Forum: Plugins
In reply to: [Loops & Logic] List LoopHello,
I may have figured out why the code is not working. So the original snippet:
<List name=racing> <Item>item_1</Item> <Item>item_2</Item> </List> <Loop list=racing > <Set name="this_term"><Field /></Set> <Loop acf_repeater=page_content> <If field="content_name" value="{Get this_term}"> <Field content_text /> </If> </Loop> </Loop>
The inner loop is trying to get the ACF repeater field “page_content” from the outer loop, which is the list “racing”. But you want to get the field from the loop outside of *that*, the default loop context which is the current post.
Hmm, I’m trying to think of a solution, but it will be tricky..
<List name=racing> <Item>item_1</Item> <Item>item_2</Item> </List> <Loop acf_repeater=page_content> <Set content_name><Field content_name /></Set> <Set content_text><Field content_text /></Set> <Loop list=racing> <If check="{Get content_name}" value="{Field}"> <Get content_text /> </If> </Loop> </Loop>
It’s not particularly efficient, since the repeater loop needs to get both field values, even when the second one may not be needed. But, as far as I can think, this is the only way to get each repeater field’s child fields while inside a list loop.
Forum: Plugins
In reply to: [Loops & Logic] Random order doesn’t work with paginationHello, in the newest plugin version, the pagination feature supports order by random.
It works by passing the initially generated order of IDs to the AJAX pagination, so newly loaded pages follow the same order, instead of creating a new random list every time.