wp_nav_manu() displays a navigation menu. We can call different menu by assigning a different $menu. But the is no straightforward function to get only a submenu. For example, we may want to display a submenu on the sidebar for easier navigation.…
Category: Code Snippet
One customization in membership website is to add login / logout link somewhere on the web page. Most common place to add this link is navigation menu. Login / logout menu item can’t be added via Appearance / Menus in…
Once we start membership integration, adding non-admin users, the admin toolbar seating on top of the page for logged in users becomes annoying. The toolbar for regular user such as subscriber provides only links to edit profile or link to…
When working with plugin like WooCommerce, it is hard to avoid customization, a lots of it. In my recent project, I adopted WooCommerce to achieve product management without shopping cart experience. You guessed it, disable and hide so many options.…
WordPress built-in search function searches all post types by default. Sometimes, we want to have some controls over what should be searched and what not. For example, on a blog website, I pretty much want to limit the search within…
When someone searches your blog using WordPress built-in search engine, the results are displayed as a list. Wouldn’t it be nice if we can redirect the visitor directly to the post when there is only one match in the search…
I was ready to call it a day after long hard-working hours, then a unhappy customer dropped me a bomb, “Hey, the contact form you just touched today not sending out email. Get it fixed, NOW!”. If this sounds familiar…
“There is a new version of XYZ plugin available”. This message is so familiar to WordPress admin. But sometimes, we need to turn it off. For example, I just customized a plugin, and don’t want my customization code being overwritten…
Themes are designed very differently from each other. I found myself sometimes use columns template provided by some themes to achieve sidebar like layout. As it is something like 75/25 column split, not standard widget area, inserting a widget needs…
A lot of us know that, “removing WordPress version number” is a fairly popular security trick. The purpose is to hide the WordPress version number embedded in the final rendered HTML code, so to reduce the risk of being targeted…