Hard coded main navigation

Question

Theme twentyeleven Version 1.5


HELP PLEASE

I have received an answer from Mayeenul Islam but this has not resolved my question, if I can’t make the navigation show active that’s not the end of the world but I would really like to resolve the title and name issue below using what I have coded.

I have tried my hardest to find the answer myself. PHP Novice ;o/


As I can’t find a way to style the blogs main navigation to match clients main site I have removed this:

        <nav id="access" role="navigation">
            <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
            <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
            <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
            <div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
            <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
            <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
        </nav><!-- #access -->

and replaced with this:

        <nav id="access" role="navigation">
          <ul>
          <li><a href="<?php echo esc_url( get_permalink( get_page_by_path( 'the-blx' ) ) ); ?>">Home</a></li>
          <li><span class="pipe">|</span></li>
          <li><a href="<?php echo esc_url( get_permalink( get_page_by_path( 'what-the-blx-does' ) ) ); ?>">What The BLX Does</a></li>
          <li><span class="pipe">|</span></li>
          <li><a href="<?php echo get_category_link( get_category_by_slug( 'business-finance' ) ); ?>">Business Finance</a></li>
          <li><span class="pipe">|</span></li>
          <li><a href="<?php echo get_category_link( get_category_by_slug( 'business-general' ) ); ?>">Business General</a></li>
          <li><span class="pipe">|</span></li>
          <li><a href="<?php echo get_category_link( get_category_by_slug( 'blx-news' ) ); ?>">BLX News</a></li>
          <li><span class="pipe">|</span></li>
          <li><a href="<?php echo get_category_link( get_category_by_slug( 'book-of-blx' ) ); ?>">Book of BLX</a></li>
          <li><span class="pipe">|</span></li>
          <li><a href="<?php echo get_category_link( get_category_by_slug( 'johns-rant' ) ); ?>">John’s Rant</a></li>
          </ul>
        </nav><!-- #access -->

The BLX is set in the reading settings> A static page> Post page.

Now I have three issue:

STYLING

1) The #access ID in style.css was setting the font as bold when on that page but has stopped working.

#access .current-menu-item > a,
#access .current-menu-ancestor > a,
#access .current_page_item > a,
#access .current_page_ancestor > a {
font-weight: bold;
}

CODING

For Page and Category – instead of have What The BLX Does (page) or Business (category)

    1) I would like to pass the page title
    2) I would like to pass the a href title tag

So it would be something like this.

<li><a href="<?php echo esc_url( get_permalink( get_page_by_path( 'what-the-blx-does' ) ) ); ?>" title="<?php get_page_by_title( );?>"><?php get_page_by_title( );?></a></li>

<li><a href="<?php echo get_category_link( get_category_by_slug( 'business-general' ) ); ?>"  title="<?php get_category_by_title( );?>"><?php get_category_by_title( );?></a></li>

Any help would be greatly appreciated.

Thanks

Dave

0
, , , Dave 8 years 2013-08-07T06:48:07-05:00 0 Answers 74 views 0

Leave an answer

Browse
Browse