Want to add additional description text below every menu item in the header area of the Astra theme? This can be achieved using the description option in WordPress. Once you enable this option, output this description text using custom PHP code and style it using custom CSS code. Preview: Menu items with Description Text Enable… Continue Reading
menu
Automatically Adds Sub Categories as sub menu under Parent Category menu item
Assume you create Programming posts category and add it into your site menu bar. Later you are adding some sub categories like PHP, CSS, HTML, JQuery etc under Programming category. You do not need to add them manually from Menu page(Appearance -> Menus). These sub categories and any future sub category of Programming category will… Continue Reading
Hiding Cart Menu Item When Cart is Empty
I had an interesting question from a user who wants to hide the cart item from the menu when cart is empty. This tutorial will only work if you are using the WooCommerce plugin. I added the simple PHP snippets into my functions.php file. Here is the code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<?php //* do not include this line /** * Hiding the cart menu item when cart is empty * * @author Paul * @license GPL 2.0+ */ function paul_nav_menu_items( $items, $menu ) { //* get the cart page id $cart_page_id = get_option( 'woocommerce_cart_page_id' ); if( ! empty( $cart_page_id ) ) { foreach( $items as $key => $item ) { if( $item->object_id === $cart_page_id && WC()->cart->is_empty() ) { unset( $items[ $key ] ); //* removing the cart menu item from list } } } return $items; } add_filter( 'wp_get_nav_menu_items', 'paul_nav_menu_items', 10, 2 ); |
There have a filter wp_get_nav_menu_items which is… Continue Reading
Different Primary Menu on Pages using Altitude PRO Theme
I did this by following steps: Step 1: First creating a default primary menu. Navigate to Appearance > Menus and create a default primary menu for your site. Check the “Primary Navigation Menu” checkbox and save this menu. Step 2: Creating another menu for pages only. Navigate to Appearance > Menus and create another menu… Continue Reading
Create Two Different Nav bars for home & inner page by JetPack plugin
JetPack is a powerful plugin for WordPress site and it is coming with lot of features. Lot of people are using this plugin today. If you already installed this plugin then you will need any extra coding for this. You will get a button “visibility” at left side of the “save” button in your every… Continue Reading
Center Header Logo & Menu in Winning Agent PRO Theme
Currently Winning Agent PRO Theme is very popular for Real State site. I worked in one project and my client was wanting to center the logo & menu at Header. I did this by following tweaks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
.title-area { float: left; padding: 12px 0; width: 100%; } .header-image .site-title a { background-position: center center !important; } .site-header .widget-area { clear: both; display: table; margin: 0 auto; text-align: center; width: 100%; } |
I added code in style.css file
Add Forum Menu in bbPress like Studiopress Forum
By 4 steps I make the menu at top in bbPress forum pages 1. Create a Widget Area. 2. Create a Menu for bbPress forum 3. Place the widget area by Hook 4. Style the Menu 1. Creating a Widget Area Add the php code in functions.php file
1 2 3 4 5 |
genesis_register_sidebar( array( 'id' => 'forum-menu', 'name' => __( 'Forum Menu Widget', 'busitech' ), 'description' => __( 'This widget area is for forum menu.', 'busitech' ), ) ); |
2. Creating a Menu for bbPress… Continue Reading