Forum Replies Created

Viewing 30 posts - 91 through 120 (of 12,012 total)
  • Author
    Posts
  • in reply to: burger menu accessibility #1494308

    try this in child-theme functions.php:

    function custom_replace_burger_anchor_with_button( $items, $args ){ 
        $pattern = '/(<li[^>]*class="[^"]*av-burger-menu-main[^"]*"[^>]*>)\s*<a([^>]*)>/is';
        $items = preg_replace($pattern, '$1<button type="button" $2>', $items);
        $items = preg_replace('/<\/a>(\s*<\/li>\s*$)/', '</button>$1', $items);
        return $items;
    }
    add_filter( 'wp_nav_menu_items', 'custom_replace_burger_anchor_with_button', 9999, 2 );


    BUT:
    Please note that in this case, you will no longer need to assign all styles to the a tag, but rather to the button tag.
    In this case, it might be better to use role=”button” and class=avia-button.

    function custom_enhance_burger_anchor_regex( $items, $args ) {
        $pattern = '/<a href="#" aria-label="(.*?)"/i';
        $replacement = '<a href="#" role="button" class="avia-button" aria-label="$1"';  
        $items = preg_replace($pattern, $replacement, $items);
        return $items;
    }
    add_filter( 'wp_nav_menu_items', 'custom_enhance_burger_anchor_regex', 9999, 2 );

    No CSS break: Since it remains an anchor-tag, all Enfold styles for the menu continue to work perfectly.
    A11y-compliant: With role=”button,” we tell the screen reader: “Ignore that there is a link here; treat this element like a button.”

    maybe it is better to not add the class avia-button because it might come into conflict with some stylings.
    use a different class there f.e.: avia-burger-button
    then you can easily select it via this class.

    in reply to: burger menu accessibility #1494306

    First of all, the icon is marked with aria-label=“Menu,” which is best practice.

    And to understand your question correctly, they consider an anchor tag with such a label to be misleading?
    So you would prefer it to be like this?

    by the way – all enfold buttons do not have the button tag – they got that extra-class : avia-button

    in reply to: Having one toggle open at time across several accordions #1494300

    try in your child-theme functions.php:

    function ava_custom_toggle_behavior(){
    ?>
    <script type="text/javascript">
    (function($) {
        $(window).on('load', function() {
            $('.toggler').on('click', function() {
                var $current = $(this);
                
                // Short delay so Enfold can set its own classes
                setTimeout(function() {
                    if ($current.hasClass('activeTitle')) {
                        // Find all other togglers on the page that are active
                        $('.toggler').not($current).each(function() {
                            if ($(this).hasClass('activeTitle')) {
                                // Simulate click or remove classes manually
                                $(this).trigger('click');
                            }
                        });
                    }
                }, 100);
            });
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'ava_custom_toggle_behavior');
    in reply to: adjust hamburger menu flyout width? #1494299

    and what about the next tab :

    in reply to: adding aria-labels to lightbox arrows/controls #1494275

    or even better – just use the team-member element as it is and parse a popup by your own.
    see with snippet on that example page: https://webers-testseite.de/teammember-vitae-2/
    PS: It is always best to examine each individual case closely, as this is the only way to offer a customized solution. Otherwise, one indulges in speculation.

    The last solution has the advantage that you only use the pure Enfold element for team members and then create your own lightbox with it. Disadvantage: you would have to rebuild your page and discard our previous design. In the window on the right side of the page, you can see that only plain text is entered in the Description Input Fiele — the Lightbox retrieves the image, name, and position from the existing DOM elements.
    To change the aria-label – just edit these lines:

    
    tPrev: 'Previous Biography',
    tNext: 'Next Biography',
    
    in reply to: adding aria-labels to lightbox arrows/controls #1494270

    i remember we made for your “leadership” members an own popup script f.e.
    if you only want to change that aria-labels of that popup script – then the solutions above are not neccessary. Only change that inline popup script
    so try to replace that script inside the functions.php snippet by (remove temporarly the observer script above)

    window.addEventListener("DOMContentLoaded", function () {	
    	(function($) {
    		$('#people').each(function(){
    		var that = this;
    			$('.flex_column', this).each(function(i){
    				if($(this).find('.mfp-hide').length){
    					$(this).find('.bio-link').attr('href','#bio-'+(i+1)).addClass('no-scroll');
    					$(this).find('.avia_image').attr('href','#bio-'+(i+1)).addClass('no-scroll');
    					$(this).find('.mfp-hide').attr('id','bio-'+(i+1)).addClass('white-popup');
    				}
    			});
    		});
    
    		$('#people .flex_column').find('a[href^="#bio-"]').magnificPopup({
    			type:'inline',
    			midClick: true,
    			removalDelay: 500,
    			mainClass: 'avia-popup mfp-fade people',
    			gallery: { 
    				enabled:true,
    				arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%" aria-label="%title%"></button>',
    				tPrev: 'Previous Biography',
    				tNext: 'Next Biography',
    			},
    		});
    
    		$('#people .flex_column').find('.avia_image[href^="#bio-"]').magnificPopup({
    			type:'inline',
    			midClick: true,
    			removalDelay: 500,
    			mainClass: 'avia-popup mfp-fade people',
    			gallery: { 
    				enabled:true,
    				arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%" aria-label="%title%"></button>',
    				tPrev: 'Previous Biography',
    				tNext: 'Next Biography',
    			},
    		});
    
    	})(jQuery);
    }); 

    better see next solution
    PS you can get rid of style part – and place the css inside quick css.

    in reply to: adding aria-labels to lightbox arrows/controls #1494258

    It depends a little on how you want to use it. If you only want to change this to “next bio” and “previous bio” for certain custom classes, we would need to rewrite this code a little.

    f.e. if you have a gallery – then you can give a custom class to that gallery element (f.e. team-member)

    function add_magnific_popup_aria_labels() {
        ?>
        <script type="text/javascript">
        (function($) {
            'use strict';
            
            if (typeof $.avia_utilities !== 'undefined' && typeof $.avia_utilities.av_popup !== 'undefined') {
                
                var originalOpenCallback = $.avia_utilities.av_popup.callbacks.open;
                
                $.avia_utilities.av_popup.callbacks.open = function() {
                    
                    if (typeof originalOpenCallback === 'function') {
                        originalOpenCallback.call(this);
                    }
                    
                    var self = this;
                    
                    setTimeout(function() {
                        // Determine labels based on the gallery container
                        var prevLabel = 'Previous image';
                        var nextLabel = 'Next image';
                        var closeLabel = 'Close lightbox';
                        
                        // Check if the clicked element (currItem.el) is inside a container with a custom class
                        if (self.currItem && self.currItem.el) {
                            var $link = $(self.currItem.el);
                            
                            // Find the parent lightbox container element
                            var $lightboxContainer = $link.closest('.avia-gallery, .av-masonry, .av-horizontal-gallery');
                            
                            if ($lightboxContainer.hasClass('team-member')) {
                                prevLabel = 'Previous person';
                                nextLabel = 'Next person';
                                closeLabel = 'Close biography';
                            } else if ($lightboxContainer.hasClass('products-gallery')) {
                                prevLabel = 'Previous product';
                                nextLabel = 'Next product';
                                closeLabel = 'Close product gallery';
                            } else if ($lightboxContainer.hasClass('projects-gallery')) {
                                prevLabel = 'Previous project';
                                nextLabel = 'Next project';
                                closeLabel = 'Close project gallery';
                            }
                            // Add more conditions as needed
                        }
                        
                        $('.mfp-arrow-left').attr('aria-label', prevLabel);
                        $('.mfp-arrow-right').attr('aria-label', nextLabel);
                        $('.mfp-close').attr('aria-label', closeLabel);
                    }, 50);
                };
                
                var originalChangeCallback = $.avia_utilities.av_popup.callbacks.change;
                
                $.avia_utilities.av_popup.callbacks.change = function() {
                    
                    if (typeof originalChangeCallback === 'function') {
                        originalChangeCallback.call(this);
                    }
                    
                    var self = this;
                    
                    // Update labels when changing images
                    var prevLabel = 'Previous image';
                    var nextLabel = 'Next image';
                    
                    if (self.currItem && self.currItem.el) {
                        var $link = $(self.currItem.el);
                        var $lightboxContainer = $link.closest('.avia-gallery, .av-masonry, .isotope, .av-horizontal-gallery');
                        
                        if ($lightboxContainer.hasClass('team-member')) {
                            prevLabel = 'Previous person';
                            nextLabel = 'Next person';
                        } else if ($lightboxContainer.hasClass('products-gallery')) {
                            prevLabel = 'Previous product';
                            nextLabel = 'Next product';
                        } else if ($lightboxContainer.hasClass('projects-gallery')) {
                            prevLabel = 'Previous project';
                            nextLabel = 'Next project';
                        }
                    }
                    
                    $('.mfp-arrow-left').attr('aria-label', prevLabel);
                    $('.mfp-arrow-right').attr('aria-label', nextLabel);
                };
            }
            
        })(jQuery);
        </script>
        <?php
    }
    add_action('wp_footer', 'add_magnific_popup_aria_labels', 999);

    you see this line includes masonry etc. if you like:

    // Find the parent lightbox container element
    var $lightboxContainer = $link.closest('.avia-gallery, .av-masonry, .av-horizontal-gallery');
    
    in reply to: adding aria-labels to lightbox arrows/controls #1494256

    I remember the team members very well. Didn’t we write an extra pop-up script for that? Maybe it would be better to add a call-back there.
    You could also try hooking into the magnificPopup script and using the callback function to insert the aria labels.

    function add_magnific_popup_aria_labels() {
    ?>
    <script type="text/javascript">
    (function($) {
    'use strict';
            
            // Extend the existing MagnificPopup callbacks
            if (typeof $.avia_utilities !== 'undefined' && typeof $.avia_utilities.av_popup !== 'undefined') {
                
                // Save the original open callback function
                var originalOpenCallback = $.avia_utilities.av_popup.callbacks.open;
                
                // Overwrite the open callback function
                $.avia_utilities.av_popup.callbacks.open = function() {
                    
                    // Execute the original function
                    if (typeof originalOpenCallback === 'function') {
                        originalOpenCallback.call(this);
                    }
                    
                    // Add aria-labels to the navigation arrows
                    setTimeout(function() {
                        $('.mfp-arrow-left').attr('aria-label', 'Previous Bio');
                        $('.mfp-arrow-right').attr('aria-label', 'Next Bio');
                        $('.mfp-close').attr('aria-label', 'Close Lightbox');
                    }, 50);
                };
                
    			// Also add a change callback to ensure 
    			// that the labels are still present when the images change.
                var originalChangeCallback = $.avia_utilities.av_popup.callbacks.change;
                
                $.avia_utilities.av_popup.callbacks.change = function() {
                    
                    // Execute the original function
                    if (typeof originalChangeCallback === 'function') {
                        originalChangeCallback.call(this);
                    }
                    
                    // Ensure that aria-labels are present
                    $('.mfp-arrow-left').attr('aria-label', 'Previous Bio');
                    $('.mfp-arrow-right').attr('aria-label', 'Next Bio');
                };
            }
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_magnific_popup_aria_labels', 999);

    Solutions
    This security issue has a low severity impact and is unlikely to be exploited.

    maybe it is not so urgent ;)

    ____________________
    Perhaps it’s time to introduce a nonce solution for all Enfold scripts?
    (for my own i have written a small plugin that will bring to every script/inline-script a nonce-key; and my csp directive says:
    script-src ‘nonce-key==’ ‘strict-dynamic’ ) that is the best against XSS – and check f.e. on: https://securityheaders.com/?q=https%3A%2F%2Fwebers-testseite.de&followRedirects=on )

    in reply to: Small border after changes in the layout #1494215

    there is a globaly set rule on enfold :

    .container_wrap {
      clear:both;
      position:relative;
      border-top-style:solid;
      border-top-width:1px
    }

    Personally, I consider them unnecessary. This is what I set on my installation:

    #top .container_wrap {
      border: none !important;
    }

    But that’s actually a well-known problem.

    in reply to: Fullwidt Slider height #1494176

    PS – if you only want to avoid that on small screens the slider images will be less height then the inner content. there will be an option to have a min-height for it:

    in reply to: Fullwidt Slider height #1494174

    the fullwidth slider is a responsive slider. That means – the images are set to 100% width and height depends on aspekt ratio of your image.
    so if you like to get a fullwidth slider to be 50% height of the image – then your images must have an aspekt ratio of 2:1

    if you force the slider to have 50vh height …. then you will have on smaller screens a space between the slider and the next section:

    or to force that behaviour – you will then have a distortion of the images – see:
    https://webers-testseite.de/fullwidth-slider/
    and pull the browser-window bigger and smaller

    ________

    this is a fullscreen slider forced to be that way – but then images are cropped.
    https://webers-testseite.de/full-screen-slider/

    Which content in the code block does this refer to? That animated typwriting heading?

    in reply to: Create a second overlay menu #1494139

    nice …

    in reply to: Contact Form not sending emails #1494036

    In addition to the important settings mentioned above by Ismael (spf-record, DKIM1 and DMARC), you should definitely follow the recommendation to send via SMTP.

    If you wish to send the form using an email address that does not belong to the domain, it is advisable to include this domain in your SPF record for the domain from which it is being sent.

    by the way –

    in reply to: Change sentence in “Search Results” (German Version) #1494035

    PS diese alternative funktion:

    function my_text_strings( $translated_text, $text, $domain ){
      switch ( $translated_text ){
        case 'Suchergebnis nicht zufriedenstellend? Versuche es mal mit einem Wort oder einer anderen Schreibweise'  :  $translated_text = __( 'neue Phrase', $domain ); 
        break;
        case 'eine andere Ersetzung'  :  $translated_text = __( 'neue Phrase Nr. 2', $domain ); 
        break;
      }
      return $translated_text;
    }
    add_filter('gettext', 'my_text_strings', 20, 3);

    funktioniert natürlich nur, wenn du auch die de_DE.po nutzt und nicht die Formale Variante oder gar gar Österreich, Schweiz

    in reply to: Change sentence in “Search Results” (German Version) #1494034

    was meinst du mit “mit Dreamweaver eingesetzt” ?
    (ich kenne Adobe Dreamweaver – aber warum mit dem hier arbeiten? poedit speichert doch die Files ab?)

    die po files sind übrigens nicht die, die herangezogen werden – sondern die mo-files die po sind zum editieren gedacht. ;)

    kannst du deine child-theme functions.php mal posten?

    in reply to: add description to video elements for accessibility #1494028

    by the way: if you like to have the hight of the descriptive box ruled by enfolds text-block fold /unfold setting – just remove that height and overflow styling inside the snippet (// 3. Output the result)

    and
    if you like to have that text only for SEO pupose – use that setting for invisibility from my page
    if you like to have it only for SEO : use that setting globaly:

    #top .yt-desc-box {
      border: 0 !important;
      clip: rect(0 0 0 0);
      height: 1px !important;
      margin: -1px;
      overflow: hidden;
      padding: 0 !important;
      position: absolute;
      width: 1px;
    }
    in reply to: add description to video elements for accessibility #1494026

    sometimes the way via youtube api v3 does not work – even if you have connected your billing details with that api.

    place a snippet to your child-theme funcions.php:
    – Registering the shortcode for the descriptive text (without api use – and google costs ;)

    
    /**
     * Final Version: Fetches YouTube description and converts links correctly
     * preventing double-tagging or broken HTML.
     */
    function get_yt_description_final($atts) {
        $a = shortcode_atts(array('id' => ''), $atts);
        if (empty($a['id'])) return 'Video ID missing.';
    
        $v_id = esc_attr($a['id']);
        
        // Use a fresh cache key to overwrite the broken HTML in your database
        $transient_key = 'yt_desc_v3_clean_' . $v_id;
        $description = get_transient($transient_key);
    
        if (false === $description) {
            $response = wp_remote_get("https://www.youtube.com/watch?v=" . $v_id, array(
                'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
            ));
    
            if (is_wp_error($response)) return 'YouTube connection error.';
    
            $html = wp_remote_retrieve_body($response);
    
            if (preg_match('/"shortDescription":"(.+?)"/', $html, $matches)) {
                $description = $matches[1];
                
                // Decode unicode characters
                $description = json_decode('"' . $description . '"');
                
                // Clean up backslashes before storing
                $description = stripslashes($description);
                
                set_transient($transient_key, $description, DAY_IN_SECONDS);
            } else {
                return 'Description currently unavailable.';
            }
        }
    
        // 1. First: Escape the raw text to be safe from XSS
        $safe_desc = esc_html($description);
    
        // 2. Second: Convert URLs into clickable links using a more precise regex
        // This regex matches URLs starting with http or https
        $pattern = '~(?<!["\'>])\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))~';
        $clickable_desc = preg_replace($pattern, '<a href="$0" target="_blank" rel="nofollow">$0</a>', $safe_desc);
    
        // 3. Output the result
        return '<div class="yt-desc-box" style="white-space: pre-wrap; word-break: break-word; background:#f9f9f9; padding:20px; border-radius:5px; border:1px solid #ddd; height:350px; overflow-y:auto;">' 
               . $clickable_desc . 
               '</div>';
    }
    add_shortcode('video_description', 'get_yt_description_final');
    

    after that – place a shortcode under your embedded video:
    [video_description id="youtube-ID"]

    see: https://webers-testseite.de/videos/
    ( there you can easily copy&paste the needed code – and see examples )

    because i do not believe that this is GDPR konform – i block it til you accept to see the youtube video.

    in reply to: add description to video elements for accessibility #1494020

    but if it is a youtube video – why not implementing descriptive text on uploading it to yt?
    I use vimeo – but i can insert on the vimeo backend a lot of info to the videos.

    Subject: How to add a descriptive text to your YouTube uploads

    Yes, there is a dedicated way to do this! When you upload a video, you use the “Description” field. This is one of the most important steps for making your video discoverable.

    Where to find it:

    During Upload: In YouTube Studio, the Description box appears right below the Video Title.

    After Uploading: You can edit it anytime by going to your Content tab in YouTube Studio, clicking the pencil icon (Details) on your video, and updating the text.

    Why it matters:

    SEO (Search Engine Optimization): YouTube’s algorithm uses this text to understand your content and show it in search results.

    User Engagement: You can include links to your website, social media, or products.

    Accessibility: It helps screen readers describe the video content to visually impaired users.

    Best Practices for your description:

    The Hook: The first two lines are the most important because they appear before the “Show More” button. Put your most vital info or call-to-action here.

    Timestamps (Chapters): If you type timestamps like 02:15 – Chapter Name, YouTube will automatically create clickable segments in the video player.

    Keywords: Use natural language to describe the video, including words people might type into the search bar.

    Hashtags: Add 2–3 relevant hashtags at the bottom (e.g., #Tutorial #Vlog) to help with categorization.

    Pro Tip: If you want to save time, go to Settings > Upload Defaults. You can save a template (like your social media links) that will automatically appear in the description box every time you upload a new video.

    in reply to: Change sentence in “Search Results” (German Version) #1494019

    du kannst ein child-theme language file hochladen (musst allerdings beide files hochladen po und mo file).
    Je nachdem welches lang file du nutzt – ich gehe mal von Du (nicht förmlich) aus. Dann musst du das file de_DE.po bearbeiten.
    Das geht ganz gut mit poedit: https://poedit.net/download
    Damit öffnest Du das file und kannst nach dem String “Suchergebnis nicht zufriedenstellend” suchen. Es gibt wohl nur eine Fundstelle. Das ersetzt du und speicherst dann ab. poedit generiert automatisch die dazugehörige mo datei.
    Beide files lädst du in dein child-theme/lang folder hoch ( der existiert nicht – erstelle ihn) –
    danach setzt du in die child-theme functions.php folgendes ein:

    function overwrite_language_file_child_theme() {
        $lang = get_stylesheet_directory().'/lang';
        return $lang;
    }
    add_filter('ava_theme_textdomain_path', 'overwrite_language_file_child_theme');

    von da an wird nun das file für die Übersetzungen genommen.

    ________________________

    PS: wenn es nur um diese eine Übersetzung geht (oder ein paar mehr) dann kannst du die Phrase auch so überschreiben – ohne ein child-theme lang file zu haben:

    function my_text_strings( $translated_text, $text, $domain ){
      switch ( $translated_text ){
        case 'Suchergebnis nicht zufriedenstellend? Versuche es mal mit einem Wort oder einer anderen Schreibweise'  :  $translated_text = __( 'neue Phrase', $domain ); 
        break;
        case 'eine andere Ersetzung'  :  $translated_text = __( 'neue Phrase Nr. 2', $domain ); 
        break;
      }
      return $translated_text;
    }
    add_filter('gettext', 'my_text_strings', 20, 3);

    bei solch langen Phrasen – geht das, da man nicht Gefahr läuft das die zufällig woanders noch auftauchen – schwierig wird es bei kurzen Begriffen.

    in reply to: CPT Sticky Posts in Masonry #1494011

    @spooniverse: I understand that, but it would be nice to check whether my code above works; since I don’t use CPT, I was reluctant to install one just to test my assumptions above.

    in reply to: Easy slider with lightbox #1494000

    12 years ago ? this seems to be deprecated.
    anyway: on the images of your slider – you have set on: advanced tab – link options – lightbox ?

    in reply to: Missing eye icon on login page #1493982

    well this wordpress login screen is not influenced by the themes installed !
    This is a pure wordpress setting – so you have to check where it might be set a different Login Page.

    i often make an own settup for it by this snippet for child-theme functions.php:

    function custom_loginlogo_url($url) {
      $url = get_site_url();
      return $url;
    }
    add_filter( 'login_headerurl', 'custom_loginlogo_url' );
    
    function my_login_logo(){ 
    $logo = avia_get_option('logo'); 
    ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
          background-image: url(<?php echo $logo; ?>);
          height: 120px;
          width: 320px;
          background-size: contain !important;
          background-repeat: no-repeat;
          background-position: center top;
          position: relative;
          left: 50%;
          transform: translateX(-50%);
        }
        body.login {
          background-image: -webkit-radial-gradient(circle farthest-corner at center center, #B8E1FC 0%, #231421 100%) !important;
          background-image: radial-gradient(circle farthest-corner at center center, #B8E1FC 0%, #231421 100%) !important;
          background-repeat: repeat;
        }
        body.login form {
          background: rgba(255,255,255,0.2);
          box-shadow: 0 0 15px rgba(0,0,0,0.3);
        }
    </style>
    <?php 
    }
    add_action( 'login_enqueue_scripts', 'my_login_logo' );

    you see in the snippet that the logo you set in the logo input field of enfold will be dynamically inserted there. If you like to have a differente one – then insert an absolute url on that place: background-image: url(<?php echo $logo; ?>);

    this is then the look for it:

    in reply to: CPT Sticky Posts in Masonry #1493926

    here is a way to have the option by classes to style those sticky posts by an own selector:

    /**
     * Add a custom CSS class to sticky posts for styling purposes
     */
    function add_sticky_classes( $classes, $class, $post_id ) {
        if ( is_sticky($post_id) ) {
            $classes[] = 'is-sticky-post';
            $classes[] = 'stickypost-' . $post_id;
        }
        return $classes;
    }
    add_filter( 'post_class', 'add_sticky_classes', 10, 3 );
    /* Style sticky items in Masonry */
    .is-sticky-post .av-inner-masonry::after {
        content: 'Featured';
        position: absolute;
        top: 10px;
        right: 10px;
        background: #000;
        color: #fff;
        padding: 2px 8px;
        font-size: 10px;
        text-transform: uppercase;
        z-index: 5
    }
    in reply to: CPT Sticky Posts in Masonry #1493925

    if this works – here is the extended Way trying to have that for pagination or “load more” Masonry:

    /**
     * ENFOLD MASONRY: Show Sticky Posts first in Blog/Portfolio Masonry only
     * (excludes Masonry Galleries)
     */
    function avia_masonry_entries_query_mod($query, $params) {
        // Exit if admin
        if (is_admin()) return $query;
        
        // Exit if this is a Masonry Gallery
        if (isset($params['container_class']) && $params['container_class'] === 'av-masonry-gallery') {
            return $query;
        }
        
        // Exit if post_type is attachment (additional safety check)
        if (isset($query['post_type']) && $query['post_type'] === 'attachment') {
            return $query;
        }
        
        // Exit if no sticky posts exist
        $sticky = get_option('sticky_posts');
        if (empty($sticky)) return $query;
        
        // Get the limit from element settings
        $per_page = isset($query['posts_per_page']) ? $query['posts_per_page'] : 6;
        
        // Fetch all non-sticky posts matching the query
        $args = array(
            'post_type'      => $params['post_type'],
            'post__not_in'   => $sticky,
            'posts_per_page' => -1, 
            'fields'         => 'ids',
            'tax_query'      => !empty($query['tax_query']) ? $query['tax_query'] : array(),
        );
        $other_posts = get_posts($args);
        
        // Merge sticky posts first, then others
        $all_ids = array_merge($sticky, $other_posts);
        
        // Apply the ordered IDs to the query
        $query['post__in'] = wp_parse_id_list($all_ids);
        $query['orderby']  = 'post__in';
        $query['order']    = 'ASC';
        $query['posts_per_page'] = $per_page;
        $query['ignore_sticky_posts'] = true;
        
        return $query;
    }
    add_filter('avia_masonry_entries_query', 'avia_masonry_entries_query_mod', 10, 2);

    EDIT: i changed the code with a check if it is an image masonry – because it should not influence these masonries.

    in reply to: CPT Sticky Posts in Masonry #1493924

    can you test this instead ( and remove your solution temporarly ) :

    /**
     * Enfold Masonry Filter: Show sticky posts first, followed by other entries (including CPTs)
     * This filter captures selected post types dynamically from the element settings.
     */
    function avia_masonry_entries_query_mod($query, $params) {
        // Prevent the filter from running in the WordPress admin backend
        if (is_admin()) {
            return $query;
        }
    
        // 1. Get the IDs of all sticky posts
        $sticky = get_option('sticky_posts');
        
        // If no sticky posts exist, return the original query without modifications
        if (empty($sticky)) {
            return $query;
        }
    
        // 2. Fetch IDs for the remaining posts (including Custom Post Types)
        // We use $params['post_type'] to dynamically support whatever is selected in the Masonry element
        $args = array(
            'post_type'      => $params['post_type'], 
            'post__not_in'   => $sticky,         // Exclude stickies so they aren't duplicated
            'posts_per_page' => -1,              // Fetch all IDs to ensure we have enough for the merge
            'fields'         => 'ids',           // Performance optimization: only fetch IDs
        );
    
        // If a specific taxonomy/category is selected in the element, apply it to our helper query
        if (!empty($params['taxonomy'])) {
            $args['tax_query'] = array(
                array(
                    'taxonomy' => $params['taxonomy'],
                    'field'    => 'id',
                    'terms'    => explode(',', $params['categories']),
                ),
            );
        }
    
        $other_posts = get_posts($args);
    
        // 3. Merge the arrays: Stickies first, then the remaining posts
        $combined_ids = array_merge($sticky, $other_posts);
    
        // 4. Sanitize the IDs (ensure they are integers)
        $query['post__in'] = wp_parse_id_list($combined_ids);
        
        // 5. Force the Masonry to respect the exact order of our merged array
        $query['orderby'] = 'post__in'; 
        $query['order']   = 'ASC'; 
        
        // Set the final limit of items to display
        $query['posts_per_page'] = 6; 
    
        // Disable default sticky handling to prevent WP from interfering with our custom order
        $query['ignore_sticky_posts'] = true;
    
        return $query;
    }
    add_filter('avia_masonry_entries_query', 'avia_masonry_entries_query_mod', 10, 2);
    
    in reply to: Quick way to import table content and format #1493876

    have a look at https://en-gb.wordpress.org/plugins/tablepress/
    it might be interesting because it can handle excel tables or csv etc.

    in reply to: Custom Fonts in Enfold Theme #1493841

    you can use f.e. keka (download) to compress or : you can still download a little app i wrote. it is a shell-script. Just unzip that file and place the app to your desktop.
    Now you can drag&drop files or folders to that icon. If you do not enter a new name – the generated zip will be named as the source file or folder:

    https://webers-testseite.de/zip-it.zip
    because it is then an app from the internet you had to allow it on OSX the first time to execute.


    (sorry these are screenshots from my german OSX Mac.)
    do not move to bin – klick the gray button and then open : system preferences – Data protection and security and on Security allow the app to open anyway.

    see here how i made that automator app: https://kriesi.at/support/topic/how-to-submit-and-use-custom-fonts/#post-1470903

    the downloaded app will have now an included icon and it will look like this :

    see here for keka usage: https://kriesi.at/support/topic/trouble-importing-tff-or-woff-fonts/#post-1492002

    _____________ :lol
    PS: That’s only because I’m lazy. For example, I also created an Automator app that converts an mkv with dts sound into an mkv with ac3 sound via ffmpeg. Without remuxing the video ;)

    in reply to: Text Align Justified #1493820

    because your css is merged – i can not say where you set this rule – but this might be the reason for it:
    it is in this css block – with comment:

    /**handles:avia-module-blog**/
    /* ======================================================================================================================================================
    #Blog Styles
    ====================================================================================================================================================== */
    #top .fullsize .template-blog .post .entry-content-wrapper {
      text-align: justify;
      font-size: 1.15em;
      line-height: 1.7em;
      max-width: 800px;
      margin: 0 auto;
      overflow: visible;
    }

    if you do not find it – you can overwrite that rule by higher selectivity:

    #top #wrap_all .fullsize .template-blog .post .entry-content-wrapper {
      text-align:  left;
    }

Viewing 30 posts - 91 through 120 (of 12,012 total)