Viewing 30 posts - 1 through 30 (of 31 total)
  • Author
    Posts
  • #816973

    hey there,

    i need a little bit help. i got a few main menu links with anchors to the same page. the problem is the corlor of the “active” section. i found some threads, but no solution.

    i need the active section highlighted. not all :-)

    #817005

    Hey volmering,

    Can you elaborate on the issue a bit more. I’m not understanding what you need.

    Best regards,
    Jordan Shannon

    #817105

    hey jordan, thanks for helping.

    my english is not that good. but i try it.

    in the main menu i got two individual links with anchor-id’s. almost like a one-page-design.

    when you go to the startpage these two menu-items (ABOUT and NEWS) are already green instead of red. but they should only turn to green when i clicked one of them and the page scrolls down to the colorsection.

    #817298

    Hi,

    I see so you want them to remain red until you click to view that section?

    Best regards,
    Jordan Shannon

    #817302

    yes, f.e.

    you click on NEWS. the page scrolls down to the news-section (id news) and the color turn to green (active).

    click on ABOUT —>NEWS turn to red –> the page scrolls to the about-section (id about) and ABOUTt turns to green.

    but this is not a new question. i think im not the only who whants to know the solution

    • This reply was modified 7 years, 4 months ago by volmering.
    #817331

    Hi,

    Would you be able to provide admin info so I can log in and look into this further. Perhaps it can be fixed with some JQuery.

    Best regards,
    Jordan Shannon

    #817404

    hey jordan, logindata below

    but i need to know what you do. i want to make it safe for updates. if u need jquery then i like to use my enfold child

    #817409

    Hi,

    Anything placed within functions.php will be update proof.

    Best regards,
    Jordan Shannon

    #817412

    cool thx

    #817434

    Hi,

    No problem. I just need a little time to configure the js and I’ll let you know when its ready to test.

    Best regards,
    Jordan Shannon

    #817537

    Hi,

    Can you make the functions file writeable? I’m not able to save.

    Best regards,
    Jordan Shannon

    #817538

    done :-)

    #817570

    Hi,

    It is still not writable. Please see the following https://codex.wordpress.org/Changing_File_Permissions

    Best regards,
    Jordan Shannon

    #817661

    hey jordan see below plz

    #817885

    Hi,

    I logged into FTP and the changes still did not apply. The files on ftp don’t match what is currently on the dashboard so there is a weird disconnect somewhere.

    Best regards,
    Jordan Shannon

    #817886

    hzmm, weired. ist is possible to post the snippet?

    #817891

    Hi,

    I have to work through it live on the site so I know it actually works. As it is right I’m sure it wouldn’t work.

    Best regards,
    Jordan Shannon

    #817893

    hmm, the website is in the folder:

    #817897

    Hi,

    See private

    Best regards,
    Jordan Shannon

    #817902

    see below

    #817905

    Hi,

    No problem at all, see below.

    Best regards,
    Jordan Shannon

    #817906

    ok, ill check it.

    #817908

    Hi,

    Okay great. Again the files in that folder are identical to what you have on the wp-dash

    Best regards,
    Jordan Shannon

    #818117

    hey jordan, so weired :-)

    i can change the functions php in the goj-connection backend:

    <?php
    
    /*HELLO JORDAN */
    
    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
    if ( is_single() )
    {
    $args['title'] = get_the_title($id);
    }
    
    return $args;
    }
    
    /*TITEL Kategorie Löschen */
    
    add_filter('avf_which_archive_output','avf_change_which_archive', 10, 3);
    function avf_change_which_archive($output)
    {
    	if(is_category())
    	{
    		$output = single_cat_title('',false);
    	}
    
    	return $output;
    }
    
    /*Kontaktformular */
     
     add_filter('avf_form_mail_field_values', 'avia_change_checkbox_return_values', 10, 4);
    function avia_change_checkbox_return_values($value, $new_post, $form_elements, $form_params){
    if($value == 'false') $value = 'Nein';
    if($value == 'true') $value = 'Ja';
    return $value;
    }
    
    /*Lightbox Gruppierung */
    
    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
        	$(".avia_textblock .lightbox-added, .avia-image-container .lightbox-added").magnificPopup({
        		type: 'image',
        		mainClass: 'avia-popup mfp-zoom-in',
        		gallery: {
        			enabled: false,
        		},
        		callbacks: 
        		{
        			imageLoadComplete: function() 
        			{	
        				var self = this;
        				setTimeout(function() { self.wrap.addClass('mfp-image-loaded'); }, 16);
        			}
        		}
           	});
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');
    
    /*Remove sidebar on 404 pages */
    add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2);
    function avia_change_post_layout($layout, $post_id) {
        if( is_404() ) {
            $layout['current'] = $layout['fullsize'];
            $layout['current']['main'] = 'fullsize';
        }
    
        return $layout;
    }
    
    /* NEXT PREV Button nur in einer Kategorie */
    add_filter('avia_post_nav_settings', 'avia_post_nav_settings_mod');
    function avia_post_nav_settings_mod($settings)
    {
    	$settings['is_fullwidth']  = false;
    	$settings['same_category'] = true;
    	return $settings;
    }
    #818296

    Hi,

    You did this from the wp dash? Perhaps your user rights are above mine?

    Best regards,
    Jordan Shannon

    #818367

    yes, wp dash and with the same account

    #818486

    Hi,
    This is what I’m seeing on your WP-Dash. It’s not matching up:

    https://snag.gy/dJc4hn.jpg

    Best regards,
    Jordan Shannon

    #818633

    omg sorry. see below

    #818835

    Hi,

    Okay now we’re cooking. I put the following in functions.php and it works. You just need to put the news anchor.

    
    function HomePageAnchorCorrection() {
        echo '<script type="text/javascript">
                // Document ready
                jQuery(document).ready(function(){
    				jQuery("#menu-item-367 a .avia-menu-text").css("color", "#b9212d").click(function(){
    					 jQuery("#menu-item-367 a .avia-menu-text").css("color", "#19cc8a");
        				 jQuery("#menu-item-297 a .avia-menu-text").css("color", "#b9212d");
    				});
                    jQuery("#menu-item-297 a .avia-menu-text").click(function(){
                    jQuery("#menu-item-297 a .avia-menu-text").css("color", "#19cc8a");
                    jQuery("#menu-item-367 a .avia-menu-text").css("color", "#b9212d");
                });
                });
                </script>';
    }
    
    add_action( 'wp_head', 'HomePageAnchorCorrection' );

    Best regards,
    Jordan Shannon

    #818868

    thx a lot for your help. can be closed

Viewing 30 posts - 1 through 30 (of 31 total)
  • The topic ‘Main Menu with Anchor Links active’ is closed to new replies.