Viewing 30 results - 61 through 90 (of 1,619 total)
  • Author
    Search Results
  • Hello Ismael,
    If I understand correctly your explanations concerning these custom fields, I should have the same values on all my CPTs since the very same Custom Layout template is used.

    I’ll compare a few posts in my database to confirm this hypothesis and, if that’s the case, I’ll be able to leverage the power of Enfold and its new features like never before.

    I plan to do this tomorrow, and I’ll post my findings in this conversation to help anyone else who might be interested.

    Best regards,

    #1472830
    williamslyd
    Participant

    Hi there, we are using the Yoast SEO plugin to craft custom meta descriptions for blog posts. We are also using the excerpt field to write custom excerpts that display on page. Doing so has resulted in us getting warnings (in ahrefs.com) that our posts have two meta descriptions. How can I continue to use the excerpt and SEO meta description fields and to display the excerpt in the blog post widget but remove the meta description tag so that Google doesn’t see two meta descriptions?

    #1472765

    Hi,

    This text pops up when filling in the fields.

    Suspicious activity has been detected. If you believe this to be an error, please contact  (Email address hidden if logged out) .
    

    Please disable it temporarily.

    We adjusted the script a bit and added the updated_checkout event. Please try it again:

    function av_custom_script_tax_exempt() { ?>
      <script>
        window.addEventListener('DOMContentLoaded', function() {
          (function($) {
            $(function() {
              function updateTaxLabel() {
                $('.cart_totals .tax-total th, #order_review .tax-total th').each(function() {
                  var text = $(this).text();
                  if (text.includes('Tax')) {
                    $(this).html(text.replace('Tax', 'Tax (<a href="https://example.com/tax-exempt-info" target="_blank">Tax Exempt?</a>)'));
                  }
                });
              }
    
              setTimeout(updateTaxLabel, 2000);
    
              $(document.body).on('updated_checkout', function() {
                updateTaxLabel();
              });
            });
          })(jQuery);
        });
      </script>
    <?php
    }
    add_action('wp_footer', 'av_custom_script_tax_exempt', 99);
    

    Best regards,
    Ismael

    Thank you Ismael for your answer.
    I’ll analyse the values of these fields and try to determine how to set them programmatically.

    The meta fields I’m the less sure about are the following (the values displayed below are from a CPT where I activated ALB manually) :

    • _avia_builder_shortcode_tree : a:1:{i:0;a:3:{s:3:”tag”;s:16:”av_custom_layout”;s:7:”content”;a:0:{}s:5:”index”;i:0;}}
    • _av_alb_posts_elements_state : a:1:{s:16:”av_custom_layout”;b:1;}

      Do you know if there is any Enfold documentation about the way their values are generated ?

      Best regards,

    Thank you Ismael for your answer.

    Do you have some information about the expected values of each of these meta fields ?

    As each entry will use the same CPT and “Custom Layout”, I guess that I can anticipate the values even if some “post ID” or other parameters are included.

    It seems to me that being able to quickly mass publish CPTs (using ALB) is a fine demonstration of the power of Enfold and its great “Custom Layout” functionality!

    Best regards,

    Hello Ismael,
    thank you for your quick answer !
    Unfortunately I can’t use the import/export tools for this CPT because it’s an Excel database of hundreds of entries from my customer that I need to transform into this freshly created CPT.

    So I’ve prepared my Custom Layout for this CPT (as well as all my custom fields, with ACF) and I’d like to be able to import the data and programmatically activate the Advanced Layout Editor.

    Using only the custom field _aviaLayoutBuilder_active with the “active” value, the Advanced Layout Editor is well activated but not rendered in frontend. I have to open the edition page of each CPT manually and then click “Update” in order to generate the proper avia custom fields.

    It’s quite frustrating to see that all my CPTs are ready, with the right content, but that because of this small detail there’s still a manual operation to perform on hundreds of posts.

    Best regards,

    agencelarsen
    Participant

    Hi everyone,
    I’m testing the Dynamic Content new feature along with the Custom Layout and it works like a charm with ACF custom post types. Great job !

    After adding a few posts (using the custom fields defined for my CPT) manually, I tried importing the 200 posts I have into a CSV file using the plugin “Ultimate CSV Importer Free” (I’m not advertising, it’s just one of many but it’s free and works with CSV instead of WordPress native XML import/export files).

    I then noticed that my CPTs were displayed by default in the form of a blog post with the shortcodes of my Custom Layout content displayed in plain text.

    Then I saw that there was a field in the database called _aviaLayoutBuilder_active that had an active value, but it doesn’t seem to be enough to activate ALB on the post.

    Can you tell me what other custom fields are used to properly activate the Advanced Layout Editor on a post, and what values to give them?
    I can see that activating the Advanced Layout Editor then updating the post generates a lot of additional fields in the _postmeta table :

    • _aviaLayoutBuilder_active : active
    • _edit_lock : 1732749476:1
    • _edit_last : 1
    • _avia_sc_parser_state : disabled
    • _av_css_styles : a:0:{}
    • _custom_layout_post_id :
    • _aviaLayoutBuilderCleanData : [av_custom_layout link='alb_custom_layout,653' av_uid='av-m3u7m8lu' sc_version='1.0']
    • _avia_builder_shortcode_tree : a:1:{i:0;a:3:{s:3:”tag”;s:16:”av_custom_layout”;s:7:”content”;a:0:{}s:5:”index”;i:0;}}
    • _av_el_mgr_version : 1.0
    • _av_alb_posts_elements_state : a:1:{s:16:”av_custom_layout”;b:1;}
    #1472303

    Topic: Slow speed website

    in forum Enfold

    Hello,
    I’m trying to resolve the speed problem on my website using the query monitor plugin
    I’ve found that there are two main reasons:
    – aviaDynamicContent->get_default_custom_fields()
    – layerslider_delete_caches()
    Is it possible to speed up the query linked to these functions somehow? or disable them? I do not use layerslider.

    Wegen etwas höherer Browser Kompatibilität (so war es jedenfalls mal bei Safari und clamp) nutze ich für fluide font-size Definitionen die min/max Methode.
    Siehe Link in Enfold Typography Sektion: https://spencermortensen.com/articles/typographic-scale/ wählte ich die musikalische Skala – und zwar einmal mit Faktor 2 und dann 3 ergeben sich folgende font-size Größen:
    40-60, 36-50, 32-42, 28-34, 25-29, 22-24
    was zu folgenden fluid Werten führt (ausgehend von einem viewport von 320px bis 1500px (Fluid-Font Calculator)
    ____
    Due to slightly higher browser compatibility, I use the min/max method for fluid font-size definitions.
    See link in Enfold Typography section: https://spencermortensen.com/articles/typographic-scale/ I chose the musical scale – once with factor 2 and then 3 the following font-size sizes result:
    40-60, 36-50, 32-42, 28-34, 25-29, 22-24
    which leads to the following fluid values (based on a viewport of 320px to 1500px (Fluid-Font Calculator)

    da Enfold selbst mit CSS Variablen arbeitet:
    as Enfold itself works with CSS variables:

    :root {
      --enfold-font-size-theme-content: 13px;
      --enfold-font-size-theme-h1: 34px;
      --enfold-font-size-theme-h2: 28px;
      --enfold-font-size-theme-h3: 20px;
      --enfold-font-size-theme-h4: 18px;
      --enfold-font-size-theme-h5: 16px;
      --enfold-font-size-theme-h6: 14px;
    }

    könnte man die mittels Filter überschreiben:
    you could overwrite them using a filter:

    function my_avf_dynamic_css_after_vars( $output = '' ){
      $output .= "\n";
      $output .= ":root {\n";
      $output .=    "--enfold-font-size-theme-h1: min(max(40px, calc(2.5rem + (60 - 40) * ((100vw - 320px) / (1500 - 320)))), 60px);\n";
      $output .=    "--enfold-font-size-theme-h2: min(max(36px, calc(2.25rem + (50 - 36) * ((100vw - 320px) / (1500 - 320)))), 50px);\n";
      $output .=    "--enfold-font-size-theme-h3: min(max(32px, calc(2rem + (42 - 32) * ((100vw - 320px) / (1500 - 320)))), 42px);\n";
      $output .=    "--enfold-font-size-theme-h4: min(max(28px, calc(1.75rem + (34 - 28) * ((100vw - 320px) / (1500 - 320)))), 34px);\n";
      $output .=    "--enfold-font-size-theme-h5: min(max(25px, calc(1.5625rem + (29 - 25) * ((100vw - 320px) / (1500 - 320)))), 29px);\n";
      $output .=    "--enfold-font-size-theme-h6: min(max(22px, calc(1.375rem + (24 - 22) * ((100vw - 320px) / (1500 - 320)))), 24px);\n";
      $output .=    "--enfold-font-size-theme-content: min(max(16px, calc(1rem + (20 - 16) * ((100vw - 320px) / (1500 - 320)))), 20px);\n";  // p-tags  
      $output .= "}\n";
    
      return $output;
    }
    add_filter( 'avf_dynamic_css_after_vars', 'my_avf_dynamic_css_after_vars', 10, 1 );

    ich behielt mal die long-hand Version der min-max schreibweise – so wird deutlich wie die font-sizes berechnet werden.
    I kept the long-hand version of the min-max notation – this makes it clear how the font sizes are calculated.

    um es dann global durchzusetzen dies in die quick css:
    to then globally enforce this here in the quick css:

    
    body {font-size: var(--enfold-font-size-theme-content);}
    #top h1 {font-size: var(--enfold-font-size-theme-h1);  }
    #top h2 {font-size: var(--enfold-font-size-theme-h2); }
    #top h3 {font-size: var(--enfold-font-size-theme-h3);  }
    #top h4 {font-size: var(--enfold-font-size-theme-h4); }
    #top h5 {font-size: var(--enfold-font-size-theme-h5);  }
    #top h6 {font-size: var(--enfold-font-size-theme-h6);  }
    

    btw: on Layout Builder – Typography Input Fields – you can activate that switch to have:
    “Activate to replace predefined selectboxes with font sizes with text fields to use custom units. Only recommended for experienced users who know, what they are doing. This is in active beta (since 5.0.1).”
    – you then can insert those fluid values to that input field. e.g. for extremly big h1 headings (80-120px) etc.

    #1471851
    clicksports
    Participant

    Hello,

    since the European Accessibility Act ist basically right around the corner, we are preparing a lot of our customer sites running Enfold to meet the new standards these days. One of our checking software found some issues with the default contact form that comes with the Enfold theme.

    The reported issues are as follows:

    Guideline: WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Fieldset.Name
    Message: This fieldset element does not have a name available to an accessibility API. Valid names are: legend element, aria-label undefined, aria-labelledby undefined.
    Code (abbreviated): <fieldset><p class=” first_form form_ele…</fieldset>

    Guideline: WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.InputText.Name
    Message: This textinput element does not have a name available to an accessibility API. Valid names are: label element, title undefined, aria-label undefined, aria-labelledby undefined.
    Code: <input type=”text” name=”avia_6_1″ class=”hidden ” id=”avia_6_1″ value=””>

    Guideline: WCAG2AA.Principle1.Guideline1_3.1_3_1.H71.NoLegend
    Message: Fieldset does not contain a legend element. All fieldsets should contain a legend element that describes a description of the field group.
    Code: (abbreviated): <fieldset><p class=” first_form form_ele…</fieldset>

    Maybe you guys can have a look at the reported issues and check if you can release an update with the coming versions.

    Thank you!

    #1471720

    Following on from this

    I can 100% confirm this was the cause of our server issues.

    Essentially ALL Enfold websites with WooCommerce installed will gradually use up the ram and see mysql memory usage rise until the server crashes.

    The bots getting stuck crawling all of the ?avia_extended_shop_select=yes queries includes:
    Even with the rel-nofollow:
    Bing bot
    Google bot
    A majority of major search engines
    AI crawlers – New aggressive bots that ignore all instructions

    See screenshot of the before and after. Our Ram use fell from almost 90GB of ram used to 8GB used on average.
    Physical Ram usage screenshot
    https://www.dropbox.com/scl/fi/tw8p399gfdr9cclorc5j9/ramuse-screenshot.PNG?rlkey=d9ty4xvui4w3m2ycb9b9ez94s&st=28aameqn&dl=0
    Mysql memory usage screenshot
    https://www.dropbox.com/scl/fi/iixhdd5vpe7253tbavbxf/mysql-memory-usage.PNG?rlkey=15061shf0haiu3d36cdy0be3t&st=ep9fncx5&dl=0

    SOLUTION
    I propose that Enfold removes the custom sort by options and reinstates the default Woocommerce ones.
    The defaults use form fields and JS so there are no a href links in the default woo sort by dropdown. Bots cannot follow these links because there are no urls in the HTML.

    In your child theme functions.php add the following to remove the enfold filters and reinstate the woo ones.

    // remove the enfold sort by filters
    function avia_woocommerce_frontend_search_params()
    {
       return;
    }
    // reinstate the woo default sort by filters
    add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 20 );

    Add the following CSS to quick CSS and tweak depending on your sidebar position:

    .sort-param-count {
    display:none;
    }
    .product-sorting {
    padding-top:0px;
    }
    div .product-sorting ul, div .product-sorting li {
    font-size: 16px;
    }
    div .product-sorting ul {
    width: 200px;
    }
    .main_color .sort-param a {
        color: #000000;
    }
    .sort-param-sort a, ul.sort-param-order {
    border: 1px;
    border-color: #969696;
    border-style: solid;
    }
    @media only screen and (max-width: 767px) {
        .responsive #top .woocommerce-ordering {
            position: relative;
            float: left;
            clear: both;
            margin: 0;
            padding-bottom: 25px;
            padding-top: 15px;
            top: 0px;
        }
    }
    @media only screen and (min-width: 768px) {
        .responsive #top .woocommerce-ordering {
            position: relative;
            float: left;
            clear: both;
            margin: 0;
            padding-bottom: 25px;
            padding-top: 15px;
            top: 0px;
        }
    }
    #top.woocommerce-page .woocommerce-ordering select {
    width: 100%;
    font-size:16px;
    }

    Install the Redirection Plugin:

    Add the following RegEX expression to redirect the queries so that the URL redirects BEFORE the query runs on the DB

    Source URL: ^/(.*?)/\?avia_extended_shop_select=.*
    Enable: Ignore Case, Regex and Ignore Slash
    Target URL: /$1/
    Hit Save
    This will redirect any attempt to crawl the enfold filters back to the current category

    Assuming you refer to functions.php – then our site would not work! we have code in functions.php to enable the learning management system learndash to operate and to avoid conflicts between woocommerce shop and ENFOLD. We have not made any changess in this for some time. The problem of false SQL detection and helper-assets is very recent

    This is the code in the functions.php – do you see anything that may cause problems?:
    <?php

    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    /*
    * Remove fields from woocommerce checkout page
    * /
    /**
    Remove all possible fields by removing the commented out areas
    **/
    function wc_remove_checkout_fields( $fields ) {

    // Billing fields
    //
    /*
    unset( $fields[‘billing’][‘billing_company’] );
    unset( $fields[‘billing’][‘billing_email’] );
    unset( $fields[‘billing’][‘billing_phone’] );
    unset( $fields[‘billing’][‘billing_state’] );
    unset( $fields[‘billing’][‘billing_first_name’] );
    unset( $fields[‘billing’][‘billing_last_name’] );
    unset( $fields[‘billing’][‘billing_address_1’] );
    unset( $fields[‘billing’][‘billing_address_2’] );
    unset( $fields[‘billing’][‘billing_city’] );
    unset( $fields[‘billing’][‘billing_postcode’] );
    */

    // Shipping fields
    /*
    unset( $fields[‘shipping’][‘shipping_company’] );
    unset( $fields[‘shipping’][‘shipping_phone’] );
    unset( $fields[‘shipping’][‘shipping_state’] );
    unset( $fields[‘shipping’][‘shipping_first_name’] );
    unset( $fields[‘shipping’][‘shipping_last_name’] );
    unset( $fields[‘shipping’][‘shipping_address_1’] );
    unset( $fields[‘shipping’][‘shipping_address_2’] );
    unset( $fields[‘shipping’][‘shipping_city’] );
    unset( $fields[‘shipping’][‘shipping_postcode’] );
    */
    // Order fields
    unset( $fields[‘order’][‘order_comments’] );

    return $fields;
    }
    add_filter( ‘woocommerce_checkout_fields’, ‘wc_remove_checkout_fields’ );

    /** Added 22 Feb 2021 by Alex to enable SMTP email usage
    *
    * This function will connect wp_mail to your authenticated
    * SMTP server. This improves reliability of wp_mail, and
    * avoids many potential problems.
    *
    * For instructions on the use of this script, see:
    * https://butlerblog.com/easy-smtp-email-wordpress-wp_mail/
    *
    * Values for constants are set in wp-config.php
    */
    add_action( ‘phpmailer_init’, ‘send_smtp_email’ );
    function send_smtp_email( $phpmailer ) {
    $phpmailer->isSMTP();
    $phpmailer->Host = SMTP_HOST;
    $phpmailer->SMTPAuth = SMTP_AUTH;
    $phpmailer->Port = SMTP_PORT;
    $phpmailer->Username = SMTP_USER;
    $phpmailer->Password = SMTP_PASS;
    $phpmailer->SMTPSecure = SMTP_SECURE;
    $phpmailer->From = SMTP_FROM;
    $phpmailer->FromName = SMTP_NAME;
    }

    /* Replace logo based on ‘promotion code’ – Jelmer*/
    add_action( ‘wp_head’, ‘logo_css’, 0 );
    function logo_css() {
    $user = wp_get_current_user();
    $user_info = get_userdata($user->ID);
    $code = $user->promotion_code;
    if( strcasecmp($code, ‘RightBrains’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/04/rsz_1rightbrains.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘Polaris’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/04/rsz_polaris.jpg) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘Nyenrode’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/03/Logo-Small.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘StrategyWorks’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/09/SWSA-LOGO-3-1-e1600615027209.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘EXIN’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2021/02/Screenshot-2021-02-25-at-16.18.48.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘Beeckestijn’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/05/Beeckestijn.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘HQAI2021’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/05/Screenshot-2020-05-01-at-13.53.02.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘Assurant2020’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2020/05/rsz_assurant-logo.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘Computrain’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2021/02/CT-Small-Logo.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘NCOI’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2021/02/NCOI-Small-Logo.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘NCD’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2021/03/NCD-Kleiner.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘Randstad’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2021/04/Randstad.png) no-repeat;}</style></head>”;
    }
    if( strcasecmp($code, ‘GK2021’) == 0){
    echo “<style>span.logo{display:none;}</style></head>”;
    echo “<style>div.inner-container{background:url(https://axveco.com/wp-content/uploads/2021/04/GK-Logo-small-1.jpg) no-repeat;}</style></head>”;
    }
    }

    /* ‘Edit profile’ redirects to profile page – Jelmer*/
    add_action( ‘load-profile.php’, ‘Redirect_profile_axveco’);
    function Redirect_profile_axveco (){
    if( ! current_user_can( ‘manage_options’ ) )
    exit( wp_safe_redirect( “https://axveco.com/en/profile/&#8221; ) );
    }

    /* Redirect wp-login to loginwp screen – Jelmer*/
    add_filter( ‘login_url’, ‘my_login_page’, 10, 3 );
    function my_login_page( $login_url, $redirect, $force_reauth ) {
    $login_page = “https://axveco.com/en/loginwp/&#8221; ;
    $login_url = add_query_arg( ‘redirect_to’, $redirect, $login_page );
    return $login_url;
    }

    /* Shows headers promotion code in the admin user table – Jelmer*/
    add_filter(‘manage_users_columns’, ‘add_promotion_code_column’);
    function add_promotion_code_column($columns) {
    $columns[‘promotion_code’] = ‘Promotion Code’;
    return $columns;
    }
    /* Shows content promotion code in the admin user table – Jelmer */
    add_action(‘manage_users_custom_column’, ‘show_user_promotion_code_column_content’, 10, 3);
    function show_user_promotion_code_column_content($value, $column_name, $user_id) {
    $user = get_userdata( $user_id );
    if ( ‘promotion_code’ == $column_name )
    return $user->promotion_code;
    return $value;
    }

    /*Archive category page layout JP https://kriesi.at/support/topic/category-archive-page-change-layout-to-show-excerpt
    add_filter(‘avf_blog_style’,’avia_change_category_blog_layout’, 10, 2);
    function avia_change_category_blog_layout($layout, $context){
    if($context == ‘archive’) $layout = ‘single-big’;
    return $layout;
    }*/

    add_filter(‘avf_blog_style’,’avia_change_category_blog_layout’, 10, 2);
    function avia_change_category_blog_layout($layout, $context){
    if($context == ‘archive’) $layout = ‘blog-grid’;
    return $layout;
    }

    add_action(‘wp_footer’, ‘add_custom_tooltip’);
    function add_custom_tooltip(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘a’).removeAttr(‘title’);
    jQuery(‘img’).removeAttr(‘title’);
    });
    </script>
    <?php
    }

    /*
    * This function is required to display the location map on the contact us page
    * if removed then the map does not display – API key is from Theme Google services
    */
    add_action(‘wp_footer’, ‘gmaps_workaround’);
    function gmaps_workaround(){
    ?>
    <!–Google Maps JavaScript API –>
    <script src=”https://maps.googleapis.com/maps/api/js?key=AIzaSyCWwtEsgQqGTvuqmzrZMapkbyzqyxCKZBw”
    type=”text/javascript”></script>
    <script type=”text/javascript”>
    jQuery(document).ready(function($){
    setTimeout(function(){
    $(‘#s_pdf_frame’).attr( ‘src’, function ( i, val ) { return val; });
    }, 100);
    });
    </script>
    <?php
    }

    // add_action(‘avia_builder_mode’, “builder_set_debug”);
    function builder_set_debug()
    {
    return “debug”;
    }

    /*
    * this funciton has been updated – see above post in header
    * the original code is: $meta[‘page’][] = ‘events’;
    *
    * Adds PageBuilder to LearnDash Post Typs
    * this is to enable the Advanced Builder in LearnDash – Alex
    * see post at https://kriesi.at/support/topic/learndash-plugin/
    *
    }*/
    add_filter(‘avf_builder_boxes’, ‘add_builder_to_posttype’);
    function add_builder_to_posttype($metabox)
    {
    foreach($metabox as &$meta)
    {
    if($meta[‘id’] == ‘avia_builder’ || $meta[‘id’] == ‘layout’)
    {
    /* original code: $meta[‘page’][] = ‘events’; instead add the name of the custom post type here*/
    $meta[‘page’][] = ‘sfwd-courses’;
    $meta[‘page’][] = ‘sfwd-lessons’;
    $meta[‘page’][] = ‘sfwd-topic’;
    $meta[‘page’][] = ‘sfwd-quiz’;
    }
    }
    return $metabox;
    }

    /*
    * After installing Woocommerce bookings, the events table function was no longer needed
    * I cannot determine whether ‘Events’ post type here is related to events…
    */
    add_action( ‘init’, ‘create_post_type’ );
    function create_post_type() {
    register_post_type( ‘Events’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Events’ ),
    ‘singular_name’ => __( ‘Event’ )
    ),
    ‘public’ => true,
    ‘has_archive’ => false,
    ‘hierarchical’ => true,
    ‘supports’ => array( ‘title’, ‘editor’)
    )
    );

    register_taxonomy(
    ‘event_categories’, //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
    ‘events’, //post type name
    array(
    ‘hierarchical’ => true,
    ‘label’ => ‘Categories’, //Display name
    ‘query_var’ => true
    )
    );
    }
    /*
    * Goal here is to disable woocommerce from opening the default shop page which is incompatible with
    * our ENFOLD Child theme and appears to be the cause of the Internal Server Error intermittent failure
    * We log that the event has occurred, disbale woocommerce and then redirect to a safe page
    */
    function custom_woocommerce_redirect_shop_page() {
    if (is_shop()) {
    // Send an email to log that this event has occured

    // Get the current user info
    $current_user = wp_get_current_user();
    $username = $current_user->user_login;
    //$is_logged_in = is_user_logged_in() ? ‘Yes’ : ‘No’;

    // Send email notification if logged in (not logged in generates a hit every minute)
    if (is_user_logged_in()) {
    $to = (Email address hidden if logged out) ‘;
    $subject = ‘WooCommerce Shop Page Disable invoked’;
    $message = ‘The WooCommerce shop page open was attempted and has been disabled.’;
    $message .= ‘<br>User: ‘ . $username;
    //$message .= ‘<br>Logged in: ‘ . $is_logged_in;
    $headers = array(‘Content-Type: text/html; charset=UTF-8’);

    wp_mail($to, $subject, $message, $headers);
    }
    // Remove the default WooCommerce content for the shop page
    remove_action(‘woocommerce_archive_description’, ‘woocommerce_taxonomy_archive_description’, 10);
    remove_action(‘woocommerce_archive_description’, ‘woocommerce_product_archive_description’, 10);
    remove_action(‘woocommerce_before_main_content’, ‘woocommerce_output_content_wrapper’, 10);
    remove_action(‘woocommerce_after_main_content’, ‘woocommerce_output_content_wrapper_end’, 10);
    remove_action(‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’, 10);

    // Set up a target page to redirect to
    $alternative_shop_page = “https://axveco.com/en/your-next-step/&#8221; ;

    // Redirect to our own next steps page
    wp_redirect($alternative_shop_page);

    exit;
    }
    }
    add_action(‘template_redirect’, ‘custom_woocommerce_redirect_shop_page’);

    /*
    * End of functions.php
    */
    ?>

    #1469191

    Hi,

    Thank you for the update.

    You can apply a custom field called av_related_category_id to the product and use the ID of the category you’d like to display as its value. We also updated the filter to accommodate these changes.

    add_filter( 'woocommerce_related_products', 'avf_custom_related_products_by_custom_field', 10, 3 );
    
    function avf_custom_related_products_by_custom_field( $related_posts, $product_id, $args ) {
        $category_id = get_post_meta( $product_id, 'av_related_category_id', true );
    
        if ( ! $category_id ) {
            return $related_posts;
        }
    
        $related_products = get_posts( array(
            'posts_per_page' => $args['posts_per_page'],
            'post_type'      => 'product',
            'fields'         => 'ids',
            'tax_query'      => array(
                array(
                    'taxonomy' => 'product_cat',
                    'field'    => 'term_id',
                    'terms'    => $category_id,
                ),
            ),
        ) );
    
        return $related_products;
    }
    

    Best regards,
    Ismael

    #1469161

    Hey Jason,

    What’s going on right now doesn’t affect Enfold or Enfold users in any way.

    We added the Dynamic Content feature ( https://kriesi.at/documentation/enfold/custom-layout-and-dynamic-content/ ) and made it compatible with the ACF plugin. This feature works as expected with the SFC ( https://wordpress.org/plugins/advanced-custom-fields/ ) plugin as well.

    If you notice any compatibility issues with the SCF plugin, please let us know.

    Regards,
    Yigit

    #1469120

    Hey fabio,

    Thank you for the inquiry.

    Related products are generated by WooCommerce, and there is no default option to change which items are shown in the grid. You can try the following filter in the functions.php file to change the related products query but this will affect the site globally.

    add_filter( 'woocommerce_related_products', 'avf_custom_related_products_by_category', 10, 3 );
    
    function avf_custom_related_products_by_category( $related_posts, $product_id, $args ) {
        $category_id = 123; // Replace 123 with your desired category ID
    
        $related_products = get_posts( array(
            'posts_per_page' => $args['posts_per_page'],
            'post_type'      => 'product',
            'fields'         => 'ids',
            'tax_query'      => array(
                array(
                    'taxonomy' => 'product_cat',
                    'field'    => 'term_id',
                    'terms'    => $category_id,
                ),
            ),
        ) );
    
        return $related_products;
    }
    

    Make sure to replace $category_id with the ID of the category that you would like to display.

    Best regards,
    Ismael

    #1468475

    Hi,
    Enfold now supports the Advanced Custom Fields plugin which will help you create Custom Post Types (CPT).
    Screen Shot 2024 10 05 at 7.39.24 AM
    In the Enfold Theme Options ▸ Layout Builder ▸ Show advanced options ▸ Activate Your Custom Post Types For ALB you can enable the Advanced Layout Builder (ALB)
    Screen Shot 2024 10 05 at 7.44.06 AM
    Please see our documentation for further info

    Best regards,
    Mike

    #1467921

    Hey Ismael,

    wow, many thanks, it works, but I wasn’t exact enough. I meant only subcategories a certain product is assigned to. If a certain product category has subcategories A, B and C and a product is assigned to A and C then only A and C should be displayed. Possible?

    By activating custom elements in Enfold settings it’s possible to insert WP Post Data or ACF fields. And there are also Dynamic WP Custom Fields like Theme Custom Field Shortcodes ({av_dynamic_el src=”wp_custom_field” key=”%metakey%” default=”” link=”” linktext=”” format=””}).And so I thought I can use this. But how?

    Thanks again
    Stefan

    #1467908

    Hey westefan,

    Thank you for the inquiry.

    What do you mean by “dynamic WP custom fields”? If you want to display the subcategories of a specific parent category, you can try this shortcode in the functions.php file:

    function av_display_product_subcategories_shortcode( $atts ) {
        $atts = shortcode_atts( array(
            'category_id' => '',
        ), $atts, 'display_subcategories' );
        
        $category_id = intval( $atts['category_id'] );
        
        if ( !$category_id ) {
            return 'Please provide a valid main category ID.';
        }
        
        $args = array(
            'taxonomy'     => 'product_cat',
            'parent'       => $category_id,
            'hide_empty'   => false,
        );
        
        $subcategories = get_terms( $args );
        
        if ( empty( $subcategories ) || is_wp_error( $subcategories ) ) {
            return 'No subcategories found for this category.';
        }
        
        $output = '<ul>';
        
        foreach ( $subcategories as $subcategory ) {
            $output .= '<li>' . esc_html( $subcategory->name ) . '</li>';
        }
        
        $output .= '</ul>';
        
        return $output;
    }
    
    add_shortcode( 'av_display_subcategories', 'av_display_product_subcategories_shortcode' );
    
    

    You can use the shortcode in a Text or Code Block element.

    [av_display_subcategories category_id="123"]
    

    Best regards,
    Ismael

    #1467863
    westefan
    Participant

    Hi,
    is it possible with dynamic WP custom fields to display a product sub category of a certain main category ID within a text field?
    Thanks, Stefan

    #1467360
    lucybb2
    Participant

    Hi,

    Please see my previous thread as to where I am coming from:

    I am wondering is it possible to put out like an IF statement in custom templates with ACF.

    For example, I have ten ACF fields, but most entries I only have data for five of those fields.

    It would look much better if I don’t have data for an ACF field, then that ACF field did not show.

    E.g. If my ACF field is URL I want it to show like this is there is a URL:

    Link: http://www.websitey.com

    But I don’t want it to show like this if there is not a URL:

    Link:

    Thanks for any advice that can be offered.

    Lucy

    #1466171

    Hi,

    Mouse over on the images, Title and introduction text. Can this be done within Enfold??

    This is possible but it will require a bit of modifications such as assigning custom fields to the portfolio items. If you want to continue, please follow these steps:

    1.) Add this code in the functions.php file to register a new attribute the portfolio image which uses the value of the av_portfolio_hover_image custom field.

    function avf_add_custom_field_as_hover_image($attrs, $entry) {
        $hover_image_url = get_post_meta($entry->ID, 'av_portfolio_hover_image', true);
    
        if (!empty($hover_image_url)) {
            $attrs['data-hover-image'] = esc_url($hover_image_url);
        }
    
        return $attrs;
    }
    add_filter('avf_portfolio_image_attrs', 'avf_add_custom_field_as_hover_image', 10, 2);
    

    2.) Then add this script to create the hover effect:

    function ava_custom_script_hover_image() {
        ?>
        <script>
            (function ($) {
                function hoverImageChange() {
                    $('.grid-sort-container .grid-entry img').each(function () {
                        var $img = $(this);
                        var originalSrc = $img.attr('src');
                        var hoverImage = $img.data('hover-image');
    
                        if (hoverImage) {
                            $img.hover(
                                function () {
                                    $img.stop().fadeOut(200, function () {
                                        $img.attr('src', hoverImage).fadeIn(200);
                                    });
                                },
                                function () {
                                    $img.stop().fadeOut(200, function () {
                                        $img.attr('src', originalSrc).fadeIn(200);
                                    });
                                }
                            );
                        }
                    });
                }
    
                $(document).ready(function () {
                    hoverImageChange();
                });
            })(jQuery);
        </script>
        <?php
    }
    add_action('wp_footer', 'ava_custom_script_hover_image');
    

    3.) Edit any portfolio items, apply the av_portfolio_hover_image custom field and place the URL of the hover image.

    4.) Add this css code to disable the default image overlay

    .grid-entry a .image-overlay {
      display: none !important;
    }
    

    Best regards,
    Ismael

    Hi,
    Sorry I see your point now, you can only have one Portfolio Items Base, I recommend using posts and categories to have
    /treatments/[name of treatment]
    /treatment-area/[name treatment area]
    or you could create a CPT with Advanced Custom Fields (ACF), but it won’t be a Portfolio Item.
    or you could try a plugin like Custom Permalinks but I don’t know if it will work with the masonry element.

    Best regards,
    Mike

    #1463803

    Thank you Mike.

    I am trying this now.

    But does this mean that I have to edit every “Journal” item individually? There are thousands. I thought they’d be a way to say, if post type = X then put out these custom fields. I didn’t think I’d have to do it page by page.

    Thanks

    Lucy

    #1463687

    Hi Günter

    Thanks for your reply.

    The documentation is good, however is doesn’t explain why all the form fields are missing when i create a custom element from a contact form. IMAGE 1 is a form created in the normal way and IMAGE 2 is the same for saved as a Custom Element. As you can see all the form fields apart from the first one are missing and there isn’t a way to add them back in to the Custom Element.

    Regards
    Colin

    #1463626
    waveseven
    Participant

    Hi

    I am trying to create a email sign-up form as a custom element that can be used throughout a site. However, it appears that when you save a form as a custom element or even create a custom element from scratch it only allows one contact form element in the customize page (see image) and you cannot add any more form elements.

    Do you know how I can include more fields? I would like, name and email address and then the submit button.

    Regards
    Colin

    #1463624
    lucybb2
    Participant

    Hi,

    I’ve been struggling for a few days now trying to work out how to apply a custom template to a category so I can change the look and feel of the post pages for the posts belonging to that category. Ultimately I want to add ACF fields to them. My site is in maitenance mode at the moment, but I’m incluing my admin access details.

    How can I get a page like this to show some ACF custom fields and also modify the look of it a bit (I think the image is too big)?
    https://guardingtheguards.com/journal/garda-review-feb-1980/

    Is there a tutorial on how to this? I’m so frustrated working on this for days and getting nowwhere!

    Thanks

    Lucy

    ifranl
    Participant

    Hi Enfold!

    I’m really excited about the new feature for using ALB and templates for Custom Post Types / dynamic content! It’s great that you’ve made this possible!

    First question:
    I’m now trying to apply it to our website. I can get the content from the Title and custom fields to display, but not the featured image ({wp_custom_field:_thumbnail_id}) or an image that has been set via a custom upload field in the post ({acf_field_66a25d0c4bbd2:smbk-foto}).

    I don’t see any picture: https://ikwilopvallen.nl/smoelenboek/rene-nederhof/

    What am I doing wrong?

    Second question:
    In your video, I see that for the page overview ‘Books’, the posts are added manually in a standard element (https://ikwilopvallen.nl/activiteiten/). Is it not possible to create a custom template for the Custom Posts as well, and then load it onto that page via the ‘Custom Layout’ element on the ‘books’ page, so that ALL CUSTOM POSTS are automatically displayed there?

    Thanks in advance,
    Ita

    Hey Rustum,

    Thank you for the inquiry.

    Please note that the dynamic content feature is limited to fields with the orange database icon beside them. It will not work with the Custom ID Attribute or Custom CSS Class fields. You will need to add the ID manually.

    Best regards,
    Ismael

    #1461758

    Hi,

    Thank you for posting the temporary solution.

    As I do not have a test environment with such many posts: could you please check if adding a limit (as WP does) would help?

    e.g. like

    
    add_filter('avf_query_default_custom_fields_limit', function($limit) { return 300; });
    

    Thank you for your help in advance.

    Best regards,
    Günter

    #1461757

    Temporary fix for anyone experiencing the same issue (until the authors of Enfold fix this issue permanently):

    Add this to your child theme’s functions.php:

    // Enfold 6.0 slow query fix
    add_filter('avf_before_query_wp_default_custom_fields', function($custom_fields) { return []; });

    The dynamic custom fields don’t work anymore with this line, but at least your website is working again.

Viewing 30 results - 61 through 90 (of 1,619 total)