Viewing 1 replies (of 1 total)
  • Thread Starter Darkn3ss

    (@darkn3ss)

    I answer himself.
    I’ve used a javascript on header page of my theme.

    <script type="text/javascript">
    		function goToAnchor() {
    			var redirecthome = "https://www.yoururl.it/#home";
    			var redirectall = "https://www.yoururl.it/#all";
    			if (window.location.href !== redirecthome){
    				location.href = "#home";
    			}
    		}
    	</script>

    where “#home” is the slug of one category called “home” then in home page appears category home only.

    I call the function this:

    if (is_page(3394)){
    	?><script>goToAnchor();</script><?php
    }

    where 3394 is the ID of my home page.

Viewing 1 replies (of 1 total)
  • The topic ‘Hide "All"’ is closed to new replies.