Removing WordPress menu div tag and keeping ul [Code Snippet]

When you are working with WordPress menu then sometimes you may noticed if no menu is defined it is putting a div wrapper just above the url tag. Here is how you can remove that div and keep ul as it as. wp_nav_menu( array( ‘theme_location’ => ”, //Just keep this as empty ‘container’ => ”,Continue reading “Removing WordPress menu div tag and keeping ul [Code Snippet]”

Finding all parent pages in WodPress [Code Snippet]

Sometimes we needs to find all parent pages of current page in WordPress. It is useful to create a breadcrumb. Here is a example code snippet to find all parent pages. <ul class=”page-breadcrumbs”> <li><a href=”<?php echo home_url(); ?>”><?php _e( ‘Home’, ‘mondira’ ) ?></a></li> <?php global $post; $parent_id = $post->post_parent; $breadcrumbs = array(); while ( $parent_idContinue reading “Finding all parent pages in WodPress [Code Snippet]”

WordPress sidebars fetching on other cms with wordpress xml rpc

Recently I worked on a site which is using wordpress as it’s cms and creloaded as it’s web shop. So the wordpress was top of the shopping cart and then the shopping cart as webshop. So basically I had to develop the site using wordpress and then had to install that creloaded inside woordpress installation.Continue reading “WordPress sidebars fetching on other cms with wordpress xml rpc”

z-index of dropdown menu vs iframe (youtube) video issue

When you are using iframe to display any video, for example if you are using youtube iframe video and on your site it has a dropdown menu and your dropdown memu is showing behind the iframe video you can make it top of iframe video with below written jquery code. (function ($) { $ =Continue reading “z-index of dropdown menu vs iframe (youtube) video issue”

wordpress 404 redirect to other url

If you are using wordpress as blog of your website blog and you are using other cms as your main website now you want any 404 of wordpress blog will redirect to that other cms 404 page then you use below code example to redirect your wordpress blog 404 page. add_action(‘wp’,’determine_if_fourzerofour_page’); function determine_if_fourzerofour_page(&$arr){ global $wp_query;Continue reading “wordpress 404 redirect to other url”

Replacing media urls on wordpress posts

Sometimes we work for a website with wordpress keeping the development version on sub directory. Say are working for http://www.example.com website and currently it is live and we work for it’s new version in wordpress. So we setup a new wordpress version on new folder so the current development version is http://www.example.com/new When we areContinue reading “Replacing media urls on wordpress posts”

google Maps JavaScript API By Example

Below written code is a example of google map api which you can find from google when you sign up for google map. Using your site url and also there are a key that’s are valid only for your given link or site. Hope your script running nice But one things! You may confused! <code>Continue reading “google Maps JavaScript API By Example”