Thursday, July 28, 2022
HomeWordPress Developmentthemes - Environment friendly wp cell menu

themes – Environment friendly wp cell menu


I’ve began creating my very personal theme, im kinda new to wordpress growth so i would really like some assist/recommendation.

I began with the menu by utilizing bootstrap which works tremendous with wordpress, now what i need to obtain is a responsive menu. I attempted utilizing some plugins to avoid wasting time, however all of them didnt work for some cause. After that i attempted the wordpress method of making a cell menu. (with html/css/php/js)

After including and eradicating code to get it working i figured i may ask another person to share their knowlegde on making a wordpress cell menu.

Please verify my code beneath, some recommendation and assist to create a cell menu with toggler can be actually appreciated.

HEADER.PHP

<html <?php language_attributes(); ?>>
    <head>
        <meta charset="<?php bloginfo( 'charset' ); ?>">
        <meta identify="viewport" content material="width=device-width, initial-scale=1">
        <hyperlink rel="profile" href="http://gmpg.org/xfn/11">
        <hyperlink rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

        <?php wp_head(); ?>

    </head>

    <physique id="site-container"> 

    <header function="banner">
    <div class="container">
        <div class="row">
            <div class="col-sm-2">
                <div class="brand">
                    <?php if( has_custom_logo() ):  ?>
                        <?php 
                            // Customized brand URL
                            $custom_logo_id = get_theme_mod( 'custom_logo' );
                            $custom_logo_data = wp_get_attachment_image_src( $custom_logo_id , 'full' );
                            $custom_logo_url = $custom_logo_data[0];
                        ?>

                        <a href="<?php echo esc_url( home_url( "https://wordpress.stackexchange.com/", 'https' ) ); ?>" 
                        title="<?php echo esc_attr( get_bloginfo( 'identify' ) ); ?>" 
                        rel="house">

                            <img src="<?php echo esc_url( $custom_logo_url ); ?>" 
                                 alt="<?php echo esc_attr( get_bloginfo( 'identify' ) ); ?>"/>

                        </a>
                    <?php else: ?>
                        <div class="site-name"><?php bloginfo( 'identify' ); ?></div>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-sm-10">
                <nav class="primary-navigation">
                        <?php
                    wp_nav_menu( array(
                        'theme_location'  => 'header',
                    ) );
                ?>
                </nav>
            </div>
        </div>
    </div>
</header>

FUNCTIONS.PHP

perform weppstar_theme_setup()
 {
    // Provides <title> tag help
    add_theme_support( 'title-tag' );  
    // Add custom-logo help
    add_theme_support( 'custom-logo' );
    // Add thumbnails
    add_theme_support( 'post-thumbnails' );
    // Add weblog picture dimension
    add_image_size( 'weppstar-blog-thumbnail', 260, 175, array('heart', 'prime' ) );
    // Add HTML5 help
    add_theme_support( 'html5', array( 'search-form', 'comment-list', 'comment-form', 'gallery', 'caption' ) );
    // Menu
     register_nav_menus( array(
        'header'   => 'Desktop menu',
        'footer'   => 'Footer menu'
) );

}
add_action( 'after_setup_theme', 'weppstar_theme_setup');

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments