Forum Replies Created
-
AuthorPosts
-
here’s a workaround in the meantime…
(it’s basically a shortcode that runs a shortcode that pulls in content from another CPT post with Builder content)1) add a CPT eg “component”
2) install the plugin Custom Content Shortcodes (CCS) https://en-gb.wordpress.org/plugins/custom-content-shortcode/
3) enable the Meta Shortcodes option in CCS settings
4) create a CCS Shortcode called “component” and add this code into the editor
[content type=component name={NAME}]
(this uses CCScontent
function to pull content/fields from another post)5) add this code to your
functions.php
to enable the Avia Builder in your CPT’s content editor// add Avia Builder to CPTs function avf_alb_supported_post_types_mod( array $supported_post_types ) { $supported_post_types[] = 'component'; return $supported_post_types; } add_filter('avf_alb_supported_post_types', 'avf_alb_supported_post_types_mod', 10, 1);
you can now add this to HTML/text blocks etc in your pages, to pull in the
content
field from your CPT (ie our builder content)
[component name="my-component"]
(You could of course just use
[content type=component name="my-component"]
but I’ve added the proxy shortcode to keep it a little bit more readable)Our workaround will do for now thanks so the topic can be closed, but please be aware of the accessibility issues with the theme .
thanks that works for me!
Hi.
It’s the “Blog Posts” component. This appears to use
postslider.php
, however when I copy it to my child theme with the same path it does not seem to pick up the new codeplease can you confirm that placing it at
my-child-theme\config-templatebuilder\avia-shortcodes\postslider.php
should allow me to change it there?I’m not sure why it didn’t work if that’s the case, unless it’s a caching issue
Thanks
Joeit would appear to be part of
config-templatebuilder\avia-shortcodes\postslider.php
that the Blog Posts actually renders the item with, not blog.php.
$output .= $thumbnail ? "<a href='{$link}' data-rel='slide-".avia_post_slider::$slide."' class='slide-image' title=''>{$thumbnail}</a>" : '';
it’s the
$thumbnail
part we need to change in this instance to remove thealt
the correct method seems to be passing
false
to the alt parameter in the third argument
$thumbnail = get_the_post_thumbnail( $the_id, $image_size, array( 'alt' => false ));
we don’t really want to edit core theme files and I imagine this solution would normally be preferable, using a regex
add_filter( 'post_thumbnail_html', 'remove_thumbnail_alt', 10, 5 ); function remove_thumbnail_alt( $html, $post_id, $post_thumbnail_id, $size, $attr ) { $html = preg_replace( '/(alt)=\"(.*?)\"\s/', "", $html ); return $html; }
however I’m not sure we can run this function for only the blog posts entries
if we need to add a conditional to the core
postslider.php
file output to remove the alt if a title is available in the pod text, we need to make it a conditional on these render types
title, excerpt_read_more, title_read_moretherefore for now I’ve added a patch to
postslider.php
// patch: remove alt on image if there is a title output on the pod // $thumbnail = get_the_post_thumbnail( $the_id, $image_size ); $hasTitle = in_array($contents, ['title', 'excerpt', 'excerpt_read_more', 'title_read_more']); $thumbnail = get_the_post_thumbnail( $the_id, $image_size, ($hasTitle ? array('alt' => false) : null));
again we’d rather not edit core theme files, but I see no other solution really using filters/hooks
This reply has been marked as private.This reply has been marked as private.“Do you see different set of items when you use the pagination?”
Yes. but the page number picked up by Yoast is always 1. I’ll post a private link with this reply
for our
/articles/page/2/
on the demo site I’ve included it should be showing in the titleArticles (page: Page 2 of 2)(pagenumber: 2)
at the beginning of the title but it’s showing(page: )(pagenumber: 1)
that
pagenumber
at the end should be 2(this is likely because it’s not an archive page as such. it’s a custom page with blog content on it, but the paging isn’t implemented by the builder template)
thanks
Sorry I may not have explained properly there
the Yoast title works fine except the page number.. this variable %%pagenumber%% should pick up the number from
/page/2
but it’s always 1 not 2I think it seems to be an issue with the Enfold implementation of pagination running through
template-builder.php
I have a page
/articles
with the Avia Builder on it with some content at the top and theBlog Posts
component includedbecause it’s not running through
archive.php
the page number is not picked up for/page/2
I believe this is discussed here:
https://codex.wordpress.org/PaginationAdding the “Paged” Parameter to a Query
If WP_Query is altering the main loop and the “paged” parameter is not set you’ll need to add it with get_query_var(). This is so WordPress knows exactly what page it’s on.and here
https://wordpress.stackexchange.com/questions/120407/how-to-fix-pagination-for-custom-loopsthanks
January 23, 2020 at 2:32 pm in reply to: WPML + Page Content component issue (Resuable, Translatable blocks) #1177618also, how can I make the “Page Content” component pick up other custom post types please? (other than Page and Portfolio)
thanks
JJanuary 23, 2020 at 12:45 pm in reply to: WPML + Page Content component issue (Resuable, Translatable blocks) #1177586thanks, I did find that
av_postcontent
shortcode actually in the code base then try get it into our ownwpml_config.xml
but I don’t believe WPML supports relationship fields (I wanted to have a dropdown with the list of translated posts in it)I’ll see if I can get it to bring up the shortcode value like this
https://wpml.org/forums/topic/i-need-to-translate-specific-shortcode-attributesif i can put the relevant “Post Content”
page,id
in the link value on the translation it might stop it being overwritten when going through the translation process. (theoretical so far!)thanks
JJanuary 21, 2020 at 7:32 pm in reply to: Yoast SEO does not work with the title and page number settings #1176910this was raised here. https://kriesi.at/support/topic/yoast-enfold-pagination/
I don’t believe it’s a Yoast issue as this normally works out of the box
adding
%%page%%
into the Yoast title should bring back the page number but it doesn’t eg/blog/page/2
should give me apage 2 of 4
for the%%page%%
variable, or if i use%%pagenumber%%
it will just give me the2
.. however%%pagenumber%%
is always1
for every/page/N
it also means the canonicals are wrong
the issue appears to be in Enfold’s implementation of pagination as they all just show the main page, but should include the
page/2
part etcWhy is this not working on my paginated content?
Our plugin utilizes the built-in WordPress core functions to recognize pagination. Some plugins and theme developers have modified or created their own method of adding pagination. In these cases, custom code may need to be written by a developer to pass information between our plugin and the plugin or theme creating the pagination. Please reach out to the developer of the plugin or theme in question to request information on being compatible with our plugin.thanks.
- This reply was modified 4 years, 10 months ago by codemonkeynorth.
Hi this still isn’t working as of Enfold 4.7.1 and Yoast 12.2
If I add the %%pagenumber%% variable in my yoast page title settings, this should show in the title as
1
forblog/page/1
,2
forblog/page/2
etc (whereblog
is a page set as myposts page
in the theme appearance options). but%%pagenumber%%
always shows as 1if i use the
%%page%
variable Yoast should outputPage 2 of 4
etc for any page greater than 1 … but it’s always blank.
(sincepagenumber
is always calculated as 1 and Yoasts skips showingpage 1 of 4
)thanks
JJanuary 18, 2020 at 6:59 pm in reply to: WPML + Page Content component issue (Resuable, Translatable blocks) #1175891This reply has been marked as private.re: aria landmarks
it appears that if you add a “Colour Section” or “Grid Row” or “Tab Section” layout item in Enfold these get put outside of the
<main>
content and therefore breaks the correct accessibility landmark structurethis would presumably be fixed by not breaking them out of their wrapping container.
are we likely to see a fix to this?
thanks
November 30, 2019 at 4:58 pm in reply to: two elements with id="avia-menu" (accessibility issue) #1161465Ah thanks @guenni007. This is on version 4.4.1, so upgrading may solve it. Thanks for the info
November 30, 2019 at 6:46 am in reply to: [resolved] 404 issue (Enfold 4.4 vs 4.6 on WPEngine / nginx) #1161434For anyone interested here’s the full rule in place on nginx that covers http->https and static file custom 404’s (note our 404 page slug is
404-2
)
WPEngine tech staff created it but if anyone has any better suggestions please let me knowset $if_https 0; if ( $http_x_forwarded_proto != "https" ) { set $if_https 1; } set $if_content_includes 0; if ( $uri ~* "/wp-content|wp-includes|\.*" ) { set $if_content_includes 1; } set $force_assets "$if_https:$if_content_includes"; if ( $force_assets = "1:1" ) { rewrite ^/ https://$host$uri? permanent; } error_page 404 =404 /404-2/; error_page 403 =403 /404-2/;
- This reply was modified 4 years, 11 months ago by codemonkeynorth.
November 29, 2019 at 5:23 pm in reply to: two elements with id="avia-menu" (accessibility issue) #1161282I’ll dig around the settings to see if there’s something specific in our setup regarding mobile menu
Thanks
Jnote the second one is nested under
header_main_alternate
this is the one in the source code
<div id='header_main_alternate' class='container_wrap'><div class='container'><nav class='main_menu' data-selectname='Select a page' role="navigation" itemscope="itemscope" itemtype="https://schema.org/SiteNavigationElement" ><div class="avia-menu av-main-nav-wrap"><ul id="avia-menu" class="menu av-main-nav">
the extra one being generated by js is getting placed below
<div id='header_main'.....
- This reply was modified 4 years, 11 months ago by codemonkeynorth.
November 28, 2019 at 4:53 pm in reply to: two elements with id="avia-menu" (accessibility issue) #1161050You are only looking at the page html source.
You need to go to the inspector (dev tools) and try running this in the javascript console
jQuery('ul#avia-menu').length;
you should see 2 elements. You can also find them manually in the element inspector. As mentioned one is cloned with javascript it seems, and therefore the browser (and hence the screenreader) sees 2 elements with the same ID.
Thanks
JPS I’m not sure what Enfold is doing under the hood to clone the menu for mobile but note eg under jQuery documentation:
Note: Using .clone() has the side-effect of producing elements with duplicate id attributes, which are supposed to be unique. Where possible, it is recommended to avoid cloning elements with this attribute or using class attributes as identifiers instead.
- This reply was modified 4 years, 11 months ago by codemonkeynorth.
November 27, 2019 at 10:39 pm in reply to: [resolved] 404 issue (Enfold 4.4 vs 4.6 on WPEngine / nginx) #1160817Hi,
yes sorry I think in this case you are right. It was a coincidence that 4.4 and 4.6 were (not) working differently in that the nginx configs on the servers were also different.
I read you’d changed the 404 handling in 4.6 from another issue thread, which is why I thought there was an issue at the Enfold end.
note to anyone coming to this thread though: we had to set an nginx rule for static files pointing to our custom 404 (eg mysite.com/this-doesnt-exist.pdf), and then let WP/Enfold custom 404 setting deal with dynamic pages
thanks
JOk it appears I have to find and reselect the image from the Media Library and reselect the size there?
Clicking on the Image Element in the Avia Editor does not bring up any edit options regarding size and clicking on the image within that does not bring up the current image and applied size settings in the Media Library
It would be useful to not have to search through the Media Library and also to be able to see the currently selected size and change it.
as per HTML spec,
<p>
should not contain a<div>
eg in this portion of code from the cookie/privacy modal
<p>Google Webfont Settings:<br />↩ <div class="av-switch-aviaPrivacyGoogleWebfontsDisabled av-toggle-switch"> <label><input type="checkbox" checked id="aviaPrivacyGoogleWebfontsDisabled" class="aviaPrivacyGoogleWebfontsDisabled " name="aviaPrivacyGoogleWebfontsDisabled"><span class="toggle-track"></span><span class="toggle-label-content">Click to enable/disable google webfonts.</span></label> </div></p>
see this answer https://stackoverflow.com/a/10763952
when a browser encounters a <div> within a <p> it’ll close the <p> as per tag omission rules… so
<p><div>.....
becomes<p></p><div>.....
therefore the last </p> in the cookie block example is invalid.
- This reply was modified 4 years, 12 months ago by codemonkeynorth.
-
AuthorPosts