Register widget area

function twentysixteen_widgets_init() { register_sidebar( array( 'name' => __( 'Contact Sidebar', 'twentysixteen' ), 'id' => 'contact-sidebar', 'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ), 'before_widget' => '', 'after_widget' => '', 'before_title' => '', 'after_title' => '', ) ); } add_action( 'widgets_init', 'twentysixteen_widgets_init' ); get front code dynamic_sidebar( 'contact-sidebar' );

How To Add Pagination To Your WordPress Theme with custom query

Simply add the following code at the end of your functions.php file (or whatever file in your theme where you want to keep it). /* * Numbered Pagination * http://www.wpexplorer.com/pagination-wordpress-theme/ */ if ( !function_exists( 'wpex_pagination' ) ) { function wpex_pagination($wpex_query) { $prev_arrow = is_rtl() ? '' : ''; $next_arrow = is_rtl() ? '' : ''; … Continue reading How To Add Pagination To Your WordPress Theme with custom query

How to Add Additional File Types to be Uploaded in WordPress

add_filter('upload_mimes', 'nv_add_custom_upload_mimes'); function nv_add_custom_upload_mimes($existing_mimes){ return array_merge($existing_mimes, array( 'csv' => 'application/octet-stream', 'xml' => 'application/atom+xml', '7z' => 'application/x-7z-compressed', 'rar' => 'package/rar', 'tar' => 'package/x-tar', 'tgz' => 'application/x-tar-gz', 'apk' => 'application/vnd.android.package-archive', 'zip' => 'package/zip', 'img|iso' => 'package/img', 'gz|gzip' => 'package/x-gzip', 'deb|rpm' => 'package/x-app', 'ttf|woff' => 'application/x-font') ); return $existing_mimes; } or add in config.php define('ALLOW_UNFILTERED_UPLOADS', true);

How to Add Custom Menu to certain Position in WordPress

add_filter( 'wp_nav_menu_objects', 'add_custom_menu_links', 10, 2 ); function add_custom_menu_links( $items, $args ) { $new_links = array(); $label = 'Menu item'; // add your custom menu item content here // Create a nav_menu_item object $item = array( 'title' => $label, 'menu_item_parent' => 0, 'ID' => 'yourItemID', 'db_id' => '', 'url' => '', 'classes' => array( 'menu-item' ) … Continue reading How to Add Custom Menu to certain Position in WordPress

Create Database Tables When Plugin is Activated

function create_custom_tables(){ global $table_prefix, $wpdb; $charset_collate = $wpdb->get_charset_collate(); $tblname = 'wp_dictionary_category'; $wp_dictionary_category_table = $table_prefix . "$tblname "; #Check to see if the table exists already, if not, then create it if($wpdb->get_var( "show tables like '$wp_track_table'" ) != $wp_dictionary_category_table) { $sql = "CREATE TABLE $wp_dictionary_category_table ( id mediumint(9) NOT NULL AUTO_INCREMENT, category_name CHAR(255), category_slug CHAR(255), UNIQUE … Continue reading Create Database Tables When Plugin is Activated