How to create custom widget Area in the admin Widgets page?

To create custom widget area we will need functions.php file (should be in the root directory of the theme) to add some custom code. We use wordpress filter “widgets_init”. <?php function register_my_sidebar() { $args = array( ‘name’ => __( ‘Footer 1’, ‘theme_text_domain’ ), ‘id’ => ‘footer-widget-1’, ‘description’ => ”, ‘class’ => ”, ‘before_widget’ => ‘<li […]

Wordpess: How to display the WCK Plugin’s Custom fields in the page or post?

$meta = get_post_meta(get_the_ID(), ‘name_of_meta’, true); // name_of_meta is the name of meta box linked the the current post ID. $meta = $meta[0]; // Now in $meta variable we have all fields available in this meta box which we added in the WCK custom fields section. // We can access fields as shown below: echo $meta[‘field1’]; […]

WordPress: How to display navigation menu in your custom theme?

<?php $defaults = array( ‘theme_location’ => ‘primary’, ‘menu’ => ”, // name of the menu you created in the menus ‘container’ => ”, ‘container_class’ => ”, ‘container_id’ => ”, ‘menu_class’ => ”, ‘menu_id’ => ”, ‘echo’ => true, ‘fallback_cb’ => ‘wp_page_menu’, ‘before’ => ”, ‘after’ => ”, ‘link_before’ => ”, ‘link_after’ => ”, ‘items_wrap’ => […]