• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Addind Date to Child Theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Addind Date to Child Theme

This topic is: resolved

Tagged: css, date, menu, php, theme extras

  • This topic has 2 replies, 2 voices, and was last updated 7 years, 3 months ago by mikolena.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • February 29, 2016 at 8:22 pm #180299
    mikolena
    Member

    Hi - I would REALLY APPRECIATE any help on this.

    I've created a menu that sits on the genesis_before area and I want to add a date via CSS.

    I've added the PHP via the snippet that StudioPress has provided:

    // Enabling custom CSS to top menu
    echo'<div class="third" >';
    wp_nav_menu( array( 'theme_location' => 'third', 'container_class' => 'genesis-nav-menu' ) );
    echo'</div>';

    and

    //* Adding Theme extras through Genesis Theme Additions
    add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 );
    /**
     * Filter menu items, appending either a search form or today's date.
     * 
     * @param string $menu HTML string of list items.
     * @param stdClass $args Menu arguments.
     * 
     * @return string Amended HTML strin gof list items.
     */
    function theme_menu_extras( $menu, $args ) {
        if ('third' !== $args->theme_location )
                return $menu;
    
        $menu .= '<li class="right-date">' . date_i18n( get_option( 'date_format' ) ) . '</li>';
        
        return $menu;
    } 

    I know this might be a novice inquiry, but I'm trying to figure out how to style it in CSS and I can't seem to figure it out. It isn't showing up on the actual menu bar at all!

    Thank you!

    March 1, 2016 at 3:00 am #180316
    Brad Dalton
    Participant

    Link to the page where you got the code please.


    Tutorials for StudioPress Themes & WooCommerce.

    March 1, 2016 at 6:22 pm #180390
    mikolena
    Member

    This is a view of the page and this is the link (I'm still not too sure if local pages can be accessed).

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble