Hot answers tagged

2

A post has a js redirection script. Full Stop. If you're redirecting anything in JS, start from there as the first failure point. There's really no reason anything should be redirecting from JS on the front end. There are plenty of redirection plugins out there to handle any redirection rules you might need. Delete the script, redirect the page properly, ...


1

If that redirection script is written in the content section of the post, it is probably being called in with the rest of the content on the category page. You could add a URL check to your javascript that would look like this: if(document.URL.indexOf("foo_page.html") >= 0){ window.location.replace("http://www.w3schools.com"); } And add in your ...


1

OK, got it :-) add_filter( 'wp_nav_menu_objects', 'add_nav_menu_item_class' ); function add_nav_menu_item_class( $items ) { foreach ( $items as $item ) { $post_id = get_post_meta( $item->ID, '_menu_item_object_id', true ); $post_tags = get_the_tags( $post_id ); if ( $post_tags ) { foreach( $post_tags as $tag ) { ...


Only top voted, non community-wiki answers of a minimum length are eligible