Forum Replies Created

Viewing 23 posts - 1 through 23 (of 23 total)
  • Author
    Posts
  • in reply to: use CPT instead of page for "Page Content" element #1237557

    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 CCS content 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)

    in reply to: accessibility: blog posts component #1181576

    Our workaround will do for now thanks so the topic can be closed, but please be aware of the accessibility issues with the theme .

    in reply to: accessibility: blog posts component #1181305

    thanks that works for me!

    in reply to: accessibility: blog posts component #1180085

    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 code

    please 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
    Joe

    in reply to: accessibility: blog posts component #1179609

    it 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 the alt

    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_more

    therefore 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

    in reply to: Yoast & Enfold – Pagination #1179567
    This reply has been marked as private.
    in reply to: Yoast & Enfold – Pagination #1178716
    This reply has been marked as private.
    in reply to: Yoast & Enfold – Pagination #1178567

    “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 title Articles (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

    in reply to: Yoast & Enfold – Pagination #1177985

    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 2

    I 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 the Blog Posts component included

    because 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/Pagination

    Adding 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-loops

    thanks

    also, how can I make the “Page Content” component pick up other custom post types please? (other than Page and Portfolio)

    thanks
    J

    thanks, I did find that av_postcontent shortcode actually in the code base then try get it into our own wpml_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)

    Maintaining the Avia Layout Builder (Enfold) Compatibility with WPML

    Language Configuration Files

    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-attributes

    if 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
    J

    this 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 a page 2 of 4 for the %%page%% variable, or if i use %%pagenumber%% it will just give me the 2.. however %%pagenumber%% is always 1 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 etc

    Why 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.

    in reply to: Yoast & Enfold – Pagination #1176909

    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 for blog/page/1 , 2 for blog/page/2 etc (where blog is a page set as my posts page in the theme appearance options). but %%pagenumber%% always shows as 1

    if i use the %%page% variable Yoast should output Page 2 of 4 etc for any page greater than 1 … but it’s always blank.
    (since pagenumber is always calculated as 1 and Yoasts skips showing page 1 of 4 )

    thanks
    J

    is there some kind of shortcode for the Enfold/Avia “Page Content” component?

    I assume it could potentially be added to the wpml config to expose the field to the translation editor?

    If i know what that is, it may help with getting support from WPML

    Maintaining the Avia Layout Builder (Enfold) Compatibility with WPML

    thanks
    J

    in reply to: in place upgrade on dev site (license question) #1174564
    This reply has been marked as private.
    in reply to: ADA compliancy #1170803

    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 structure

    this would presumably be fixed by not breaking them out of their wrapping container.

    are we likely to see a fix to this?

    thanks

    in reply to: two elements with id="avia-menu" (accessibility issue) #1161465

    Ah thanks @guenni007. This is on version 4.4.1, so upgrading may solve it. Thanks for the info

    For 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 know

    
    set $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/;
    
    in reply to: two elements with id="avia-menu" (accessibility issue) #1161282

    I’ll dig around the settings to see if there’s something specific in our setup regarding mobile menu

    Thanks
    J

    note 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'.....

    in reply to: two elements with id="avia-menu" (accessibility issue) #1161050

    You 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
    J

    PS 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.

    https://api.jquery.com/clone/

    in reply to: [resolved] 404 issue (Enfold 4.4 vs 4.6 on WPEngine / nginx) #1160817

    Hi,

    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
    J

    in reply to: how to select image size? #1160795

    Ok 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.

    in reply to: Validation of pages for Google free errors #1159152

    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.

Viewing 23 posts - 1 through 23 (of 23 total)