Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1429692

    Hi,

    I need the masonry blocks not to show H3 titles by default. I have consulted the forum and there is a script to insert on each page but I need to change all the masonrys on my site at once. How can I do it? Thanks

    #1429702

    Hey keep12,

    Thank you for the inquiry.

    Are you trying to replace h3 with another tag? Please try this script in the functions.php file.

    function ava_custom_script_c()
    {
        ?>
    	<script>
    		(function($) {
    			$(document).ready(function () {
                    // replace h3 with h2
                    $('h3.av-masonry-entry-title').replaceWith(function() {
                        return $('<h2>', { class: $(this).attr('class'), itemprop: $(this).attr('itemprop'), html: $(this).html() });
                    });
                });
    		}(jQuery)); 
    	</script>
    	<?php
    }
    add_action('wp_footer', 'ava_custom_script_c');
    

    This script will convert all elements with the class “av-masonry-entry-title” from < h3 > to < h2 >.

    Best regards,
    Ismael

    #1429719

    Hi Ismael,

    Thanks for your quick reply. Actually what I need is to change them to H6, so I will change that in the script you suggest.

    Best regards!

    #1429773

    Hi keep12,

    I’m glad that Ismael could help you :)
    Just let us know if you still need further assistance.

    Best regards,
    Nikko

    #1429781

    or – instead of replacing it afterwards – use the filter avf_customize_heading_settings to influence the generation of those headings:

    function my_customized_headings_for_masonry_titles( array $args, $context, array $extra_args = array() ) {
      if( $context == 'avia_masonry' ){
        $args['heading'] = 'h6';             
      }
      return $args;
    }
    add_filter( 'avf_customize_heading_settings', 'my_customized_headings_for_masonry_titles', 10, 3 );
    #1429796

    Hi,

    Thanks @Guenni007!

    Best regards,
    Ismael

    #1429811

    Hello,

    The file functions.php is the one that is in /public_html/wp-includes, right?

    Thanks

    #1429812

    Hello,

    Thank you very much for your contribution, @Guenni007! The problem has been finally solved.

    Best regards!

    #1429820

    The functions.php is located directly in the root directory of the theme. However, if you are working without a child theme, there are a few things to consider for the parent theme. That’s why I recommend always working with a child theme: changed settings / customizations will not be lost with the next update.

    #1429843

    Hi keep12,

    If you aren’t using a child theme yet you can download it here: https://kriesi.at/documentation/enfold/child-theme/
    Or you also have the option to use a plugin like WPCode

    Best regards,
    Nikko

    #1430174

    Hello guys,

    We are using enfold child theme. But i injected the script throw the function.php file.

    Thanks

    #1430182

    if you are using the child-theme from enfold download page there was an empty functions.php file included.
    on default you can reach the editor of that file via dashboard – Appearance – Theme File Editor
    on the right side you can see the files that are included in your child-theme folder. Click on functions.php and see.
    Do not erase that first line: <?php

    after this line you can insert the shortcode snippets.

    #1430203

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1430237

    Thank you very much,

    We are going to inject the script code throw the ftp to the enfold child theme.

    Thanks :D

    #1430741

    Hi,
    Glad Guenni007 could help, thank you Guenni007, unless there is anything else we can assist with on this issue, shall we close this thread then?

    Best regards,
    Mike

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.