• lisid

    (@lisid)


    Hi. I am trying to build dynamic page on my first website. I am newbie so don’t hate me. 🙂 Its my third day with WP (and I love it). I really want to learn. I bin manage to build something by this tutorial.

    https://premium.wpmudev.org/blog/five-hacks-twenty-seventeen/#dynamic

    When I click on menu button “Úvod”, “Služby” and “Nabízíme” it scrolls to that part of the page. Thats working pretty good. Unfortunately I have two issues.

    Issue number 1: Name of the page cannot be in my language. So I have to name the page without special signs from my language. For example I have to rename “Služby” to “Sluzby” otherwise it wont work. Is there any way how to fix it? I cannot have it on my page written as a “Sluzby” its just not correct in my language.

    Correct
    Screen_Shot_2018_06_01_at_10_10_52_AM

    Incorrect
    Screen_Shot_2018_06_01_at_10_11_08_AM

    Issue number 2: If I forget about “Issue number 1” I have another one. Let’s say it works perfectly. When I am on the main page and I click on the menu button “Úvod“, “Služby” or “Nabízíme” it slides where it should and it looks amazing. Problems begins when I am going to other pages of the website “Blog“, “Galery” or “Kontakt” and try to get back to “Úvod“.

    Screen_Shot_2018_06_01_at_10_18_16_AM

    It jumps back incorrectly. I know it is possible, but I am not sure how to do it. I would like to set up. That each time when I am on the page “Blog“, “Galery” or “Kontakt” and click on “Úvod” it just go to my main page instead of “/#o-nas. That means everytime when I am on pages “Úvod“, “Služby” or “Nabízíme” and I click “Úvod” it scrolls to page named “O nas” at a beginning. When I will be on pages “Blog“, “Galery” or “Kontakt” and I click on button “Úvod” it will take me to my main website page.

    Is it possible to fix this issues I have? Could somebody please help me? I would really appreciate it. Thank you so much.

    • This topic was modified 8 years ago by lisid.
    • This topic was modified 8 years ago by lisid.
    • This topic was modified 8 years ago by lisid.
    • This topic was modified 8 years ago by lisid.
    • This topic was modified 8 years ago by lisid.
    • This topic was modified 8 years ago by lisid.
    • This topic was modified 8 years ago by lisid.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lisid

    (@lisid)

    This is JavaScript code i used. Could somebody please help me. I am really desperate already and have no idea how to fix it. Thank you so much for your help.

    /*
    One page nav code
    */

    jQuery( document ).ready(function(){
    /* Add padding and id’s to each front page section */
    jQuery( “h2.entry-title” ).each( function() {
    var panelId = jQuery( this ).html().toLowerCase().replace(/\s+/g, “-“);
    jQuery( this ).wrapInner(function() {
    return “<span style=’padding-top:96px;’ id='” + panelId + “‘></span>”;
    })
    })

    /* Remove navigation link highlighting */
    jQuery(‘#top-menu li’).removeClass(‘current-menu-item current_page_item ‘);

    /* Add highlighting on click */
    jQuery(‘#top-menu li a’).on(‘click’, function(event) {
    jQuery(this).parent().parent().find(‘li’).removeClass(‘current-menu-item’);
    jQuery(this).parent().addClass(‘current-menu-item’);
    });

    /* Check current URL and highlight nav for current page */
    jQuery(‘#top-menu li a’).each( function() {
    var pageUrl = jQuery( location ).attr( ‘href’ );
    var navUrl = jQuery( this ).attr( ‘href’ );
    if ( navUrl == pageUrl ) {
    jQuery( this ).parent().addClass(‘current-menu-item’);
    }
    })
    })

    Thread Starter lisid

    (@lisid)

    I need help. Please.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Dynamic Page’ is closed to new replies.