Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #656263

    Hi,
    I need to remove “All” from sorting menu of Magazine shortcode.

    I have tried to do customization on magazine shortcode file for removing it filter menu, But It is not automatically setting to next menu pre-selected ( Next tab to “All” menu)

    Use case: For following below url.

    I need to remove “All” and “Breaking News” should be pre-selected on initial page load.

    Can you please let me know what is the way to customize it?

    #656266

    Hey ybema!

    Please add the following to yout CSS

    a.all_short_button { display: none !important }

    Let us know if it works as should

    Best regards,
    Basilis

    #656294

    Hey Basilis,

    Hiding of Link with {display: none} won’t solve the problem.

    On initial page load “All” will be active and Related content area “av-magazine-group” will be displayed. When I will click on “Breaking News” — It will be active and related contet area “av-magazine-group” will be displayed (visible).

    I want to remove “All” link as well as it’s content block (Div). And “Breaking News” should be active along with it’s proper filtered content.

    Let me know If you want more information.

    Currently it’s binding click event from “shortcode.js”

    	$.fn.aviaMagazine = function( options )
    	{
    		console.log(this.length);
    		if(!this.length) return;
    
    		return this.each(function()
    		{
    			var _self = {};
    
    			_self.magazine		= $(this),
    			_self.sort_buttons 	= _self.magazine.find('.av-magazine-sort a');
    			_self.container		= _self.magazine.find('.av-magazine-group');
    			_self.sort_bar		= _self.magazine.find('.av-magazine-top-bar');
    
    			_self.sort_buttons.on('click', function(e){ e.preventDefault(); methods.switchMag(this, _self);  } );
    		});
    	}
    • This reply was modified 8 years, 4 months ago by ybema.
    #656342

    Hi,

    Please try adding this code to the Quick CSS section under Enfold > General Styling or to your child themes style.css file:

    
    a.all_short_button, a.all_short_button + span  { display: none !important }
    

    To auto select filter gallery use the below code in functions.php and change the eq(1) to eq(2) and so on to select different menu items.

    
    function select_portfolio_filter(){
    ?>
    <script>
    jQuery( window ).load(function() {
      jQuery(‘.inner_sort_button:eq(1)’).click();
    });
    </script>
    <?php
    }

    please note you are using caching plugin. You may not see the changes until the cached files are cleared in your browser and in the plugin settings or deactivate caching plugins till the development work is completed.

    Best regards,
    Vinay

    • This reply was modified 8 years, 4 months ago by Vinay.
    #656379

    Hi Vinay,

    Just wondering wrapping JS into function without any hook or function call won’t execute the code.

    function select_portfolio_filter(){
    ?>
    <script>
    jQuery( window ).load(function() {
      jQuery(‘.inner_sort_button:eq(1)’).click();
    });
    </script>
    <?php
    }

    What is the alternate way where in theme I can place the custom javascript code ?

    • This reply was modified 8 years, 4 months ago by ybema.
    #656671

    Hi!

    I have tested this code on my installation and it works. WordPress by default has no other alternative to add functions. Let us know what is the issue you are having so we can help you with it?

    Cheers!
    Vinay

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