Forum Replies Created

Viewing 12 replies - 256 through 267 (of 267 total)
  • And also there was JQuery not defined error, That’s why menu toggle is not working.

    @media(max-width:525px){
      nav.nav-primary{display:block;}
    }
    • This reply was modified 3 years, 6 months ago by yogeshyadav20.
    
    @media (max-width: 481px) {
    .et_header_style_left .logo_container{position:relative;width:100%;height:100%;}
    .infoBar{width:unset!important;}
    }
    Forum: Fixing WordPress
    In reply to: second categorie
    $categories = get_the_terms($post->ID, 'category' );
    $top_level_ids = [];
    foreach( $categories as $category ) {
        if( ! $category->parent ) {
            $top_level_ids[] = $category->term_id;
        }
    }
    foreach( $categories as $category ) {
        if( in_array($category->parent_id, $top_level_ids)) {
            echo $category->term_id . ', ' . $category->slug . ', ' . $category->name . '' . <strong>$category->description</strong> . '<br />';
        }
    }
    Thread Starter yogeshyadav20

    (@yogeshyadav20)

    thanks @gappiah

    • This reply was modified 3 years, 6 months ago by yogeshyadav20.
    
    <strong>Add this code in your template</strong>
    if($_POST['post_submit']=='Sumbit'){
        $user_login = $_POST['user_login'];
        $first_name = $_POST['first_name'];
        $last_name = $_POST['last_name'];
        $nickname = $_POST['nickname'];
        $email = $_POST['email'];
        $url = $_POST['url'];
        $description = $_POST['description'];
        $userdata = array(
        'user_login'    =>  $user_login,
        'user_email'    =>  $email,
        'first_name'    =>  $first_name,
        'last_name'     =>  $last_name,
        'nickname'      =>  $nickname,
        'last_name'     =>  $last_name,
        'nickname'      =>  $nickname,
        'url'           =>  $url,
        'description'   =>  $description,
        'role' => 'subscriber'
        );
        $user = wp_insert_user($userdata);
    }
    ?>
    <form class="mx-5 py-3" method="post" action="<?php echo home_url('/') ?>">
        <input class="form-control" type="text" name="user_login" placeholder="Username"><br>
        <input class="form-control" type="text" name="first_name" placeholder="First Name"><br>
        <input class="form-control" type="text" name="last_name" placeholder="Last Name"><br>
        <input class="form-control" type="text" name="nickname" placeholder="Nickname"><br>
        <input class="form-control" type="text" name="email" placeholder="Email"><br>
        <input class="form-control" type="text" name="url" placeholder="Website"><br>
        <input class="form-control" type="text" name="description" placeholder="Biographical Info"><br>
        <input class="form-control" type="text" name="address" placeholder="Address"><br>
        <input class="form-control" type="text" name="city" placeholder="City"><br>
        <input class="form-control" type="text" name="postalcode" placeholder="Postal Code"><br>
        <input class="form-control" type="text" name="test1" placeholder="Test One"><br>
        <input class="form-control" type="text" name="test2" placeholder="Test Two"><br>
        <input class="form-control" type="text" name="test3" placeholder="Test Three"><br>
        <input class="form-control" type="text" name="test4" placeholder="Test Four"><br>
        <input class="form-control" type="text" name="test5" placeholder="Test Five"><br>
        <input class="form-control" type="text" name="test6" placeholder="Test Six"><br>
        <input class="form-control" type="text" name="test7" placeholder="Test Seven"><br>
        <input class="form-control" type="text" name="test8" placeholder="Test Eight"><br>
        <input class="form-control" type="text" name="test9" placeholder="Test Nine"><br>
        <input id="sumbit" class="btn-block btn-lg" type="submit" name="post_submit" value="Sumbit" />
    </form>
    
    <strong>Add this code in your functions.php</strong>
    
    dd_action( 'show_user_profile', 'extra_user_profile_fields' );
    add_action( 'edit_user_profile', 'extra_user_profile_fields' );
    
    function extra_user_profile_fields( $user ) { ?>
        <h3><?php _e("Extra profile information", "blank"); ?></h3>
    
        <table class="form-table">
        <tr>
            <th><label for="address"><?php _e("Address"); ?></label></th>
            <td>
                <input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your address."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="city"><?php _e("City"); ?></label></th>
            <td>
                <input type="text" name="city" id="city" value="<?php echo esc_attr( get_the_author_meta( 'city', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your city."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Postal Code"); ?></label></th>
            <td>
                <input type="text" name="postalcode" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'postalcode', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test One"); ?></label></th>
            <td>
                <input type="text" name="test1" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test1', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test One"); ?></label></th>
            <td>
                <input type="text" name="test2" id="test2" value="<?php echo esc_attr( get_the_author_meta( 'test2', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test Three"); ?></label></th>
            <td>
                <input type="text" name="test3" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test3', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test Four"); ?></label></th>
            <td>
                <input type="text" name="test4" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test4', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test Five"); ?></label></th>
            <td>
                <input type="text" name="test5" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test5', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test six"); ?></label></th>
            <td>
                <input type="text" name="test6" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test6', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test seven"); ?></label></th>
            <td>
                <input type="text" name="test7" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test7', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test eight"); ?></label></th>
            <td>
                <input type="text" name="test8" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test8', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        <tr>
            <th><label for="postalcode"><?php _e("Test nine"); ?></label></th>
            <td>
                <input type="text" name="test9" id="postalcode" value="<?php echo esc_attr( get_the_author_meta( 'test9', $user->ID ) ); ?>" class="regular-text" /><br />
                <span class="description"><?php _e("Please enter your postal code."); ?></span>
            </td>
        </tr>
        </table>
    <?php }
    
    add_action( 'user_register', 'crf_user_register' );
    function crf_user_register( $user_id ) {
        update_user_meta( $user_id, 'address', $_POST['address'] );
        update_user_meta( $user_id, 'city', $_POST['city'] );
        update_user_meta( $user_id, 'postalcode', $_POST['postalcode'] );
        update_user_meta( $user_id, 'address', $_POST['address'] );
        update_user_meta( $user_id, 'test1', $_POST['test1'] );
        update_user_meta( $user_id, 'test2', $_POST['test2'] );
        update_user_meta( $user_id, 'test3', $_POST['test3'] );
        update_user_meta( $user_id, 'test4', $_POST['test4'] );
        update_user_meta( $user_id, 'test5', $_POST['test5'] );
        update_user_meta( $user_id, 'test6', $_POST['test6'] );
        update_user_meta( $user_id, 'test7', $_POST['test7'] );
        update_user_meta( $user_id, 'test8', $_POST['test8'] );
        update_user_meta( $user_id, 'test9', $_POST['test9'] );
    }

    To avoid it, you should always use isset($var_name[‘something’]) to check if the index exists (or not) in the given variable.

    WIth the help of css you can fix this like
    @media (max-width:575.98px){
    ul.main-header-menu.ast-nav-menu.ast-flex.submenu-with-border.astra-menu-animation-fade.stack-on-mobile{display:flex;flex-flow:column;}
    li.page_item.page-item-79.menu-item{order:2;}
    li.page_item.page-item-68.menu-item{order:1;}
    li.page_item.page-item-86.menu-item{order:4;}
    li.page_item.page-item-84.menu-item{order:3;}
    }
    https://www.awesomescreenshot.com/image/12564341?key=647ec9ba67b2473fddcb84efd5fc02bb

    • This reply was modified 3 years, 6 months ago by yogeshyadav20.

    it’s not WordPress menu issue, you should look into your theme.
    It’s look like that your theme is using different menu for mobile and desktop.

    Thread Starter yogeshyadav20

    (@yogeshyadav20)

    Okay, thanks @alanfuller

    Thread Starter yogeshyadav20

    (@yogeshyadav20)

    Thanks @mikekipruto

    Thread Starter yogeshyadav20

    (@yogeshyadav20)

    Is there any plugin to do that?

Viewing 12 replies - 256 through 267 (of 267 total)