Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Basics, I guess!

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #33807
    Ash149
    Participant

    Hi everyone,

    I have a few questions regarding wordpress, I think they’re kinda simple but whenever I search online I keep finding answers from about 4 years ago so thought I’d get an answer on here…

    If this has already been asked then I do apologise! (i did do a search)

    Basically, using WordPress for a CMS is all new to me! I’ve been using Joomla but have decided to give WordPress ago, now I’m building a website and I need my home page to have a different CSS file to my other pages – how do I do this?

    Next question, when I go to my website I’ve created a custom navigation and added a link called Home and linked it to ‘/’ which takes it back to the home page on my site but doesn’t give it the active item class in the menu so you can’t tell what page your on, all the other pages work fine though (for instance, when you click ‘About’ it becomes the active menu and therefore gets a specific color background).

    Any help from either above questions would be hugely appreciated thank you very much!

    Ashley

    #84549
    Ash149
    Participant

    Ok, turns out I just needed to continue watching Chris’s Lynda.com tutorial on WordPress themes for another 5 minutes and I would have got my answer to the custom CSS based on page.

    Though any help on how to make a link going to the home page would be appreciated (at the moment in my main menu I just have ‘Home’ which links to ‘/’ and I need it to go to the home page that you get when you go to the site and also for it to add the current item class to the link).

    Ash

    #84578
    clokey2k
    Participant

    I used a little bit of jQuery to highlight my menu options. I understand it’s not a perfect solution, not very dynamic – but my menu doesn’t change often. It also addresses any child of my menu i.e. a blog post will force the ‘Blog’ menu option to be highlighted.

    My code:

    $(function(){
    var p=location.pathname.substring(1); //Grab the path after the domain;
    var s=p.split("///"); //Split at slashes

    if(!p){
    //If there is nothing after the domain - We are HOME!!
    //find the 'nav' link to HOME, and make it 'selected'
    $('nav a[href="http://domain.com/"]').attr('class','selected');
    } else {
    //find the link containing the first part of URL, i.e. BLOG
    $('nav a[href*="'+s[0]+'"]').attr('class','selected');
    }
    });

    ***EDIT***
    Ok I have since noticed that it doesn’t work on my site, but the I may have changed my link structure (told you it’s not very dynamic). However the first part of the ‘if’ statement could solve your problem.

    #86612
    ekdr0
    Member

    Have you tried changing the home page to a selected static page in the admin area of wordpress?

    Found in Settings >>Reading.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.