Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Exclude categorie terms on layer slider #1130379

    Hi Victoria,

    Finally i have been able to solve it without plugin, i have called it from wp_head in function, there was the main problem.

    Here is the final code working fine

    //CUSTOM JQUERY
    //QUITAR CATEGORIAS DEL SLIDER
    function add_custom_code(){
    ?>
    <script>
    jQuery(document).ready(function( $ ){
       $( ".banner-categorias a:contains('_')" ).css( "display", "none" );
       $( ".cat-item:contains('_')" ).css( "display", "none" );
      });
    </script>
    <?php
    }
    add_action('wp_head', 'add_custom_code'); 

    Thanks a lot for your support and interest.

    Best regards

    • This reply was modified 5 years, 11 months ago by minguela.
    in reply to: Exclude categorie terms on layer slider #1130289

    Thanks again, Victoria

    Ok, but the exact piece of code in funtions.php that not want to works is:

    //CUSTOM JQUERY
    function add_custom_code(){
    ?>
    
    <script>
    
    $(document).ready(function () {
    $( ".ls-layer a:contains('_')" ).css( "display", "none" );
    $( "#banner-categorias a:contains('_')" ).css( "display", "none" );
    });
    
    </script>
    			
    	
    <?php
    }
    add_action('wp_footer', 'add_custom_code');

    FYI

    Regards

    in reply to: Exclude categorie terms on layer slider #1129942

    Solved!

    Using a plugin for the jquery code and runs fine!

    I dont know why the code dont work in functions, maybe because is in the bottom of the page?…

    Enfold is the best theme, I’m in love with it, but always i miss a box in the backoffice for insert pieces of custom javascript code. No one is perfect ;)

    Thanks again for your support

    in reply to: Exclude categorie terms on layer slider #1129933

    Hi Victoria

    Thanks for your reply, your solution hide all the categories in the banner, and i want to hide only the categories with “_” in the string.

    Do you know why this code dont want to work?

    $(document).ready(function () {
    $( ".ls-layer a:contains('_')" ).css( "display", "none" );
    $( "#banner-categorias a:contains('_')" ).css( "display", "none" );
    });

    on this piece of html generated by layer slider?

    <div style="top: 153px; left: 365.5px; font-size: 18px; margin: 0px; z-index: auto; width: 438px; height: 22px; padding: 0px; border-width: 0px; border-radius: 0px; line-height: 21.0833px; letter-spacing: 0px; filter: none;" class="ls-layer" id="banner-categorias" data-ls-slidein="1" data-ls-slideout="1" data-ls-active=""> 
    <a href="https://coldwell.crescendoworks.com/categoria/destacado-home/">_destacado_home</a>, 
    <a href="https://coldwell.crescendoworks.com/categoria/_header-slider-home/">_slider home</a>,
    <a href="https://coldwell.crescendoworks.com/categoria/marketing-inmobiliario/">Marketing Inmobiliario</a>
    </div>

    Is so strange, what im doing wrong? is placed in funtions.php in a child folder and the code works fine in the simulator https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_sel_contains

    Thanks again.

    I send you credentials to private.

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