WordPress not reflecting changed of the database

I’d suggest to try using this: http://interconnectit.com/products/search-and-replace-for-wordpress-databases/ As @s_ha_dum has said, it looks like you’ve missed something. The above script automates the process of updating all URL references within the database when changing folder/URL and is much quicker and easier. You’ve probably missed some entries as some references to the URL are stored as serialized … Read more

Page Automatically Generated from Theme?

Put this in your functions.php file: $contact_query = new WP_Query(array( ‘pagename’ => ‘contact’, ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, )); if (! $contact_query->post_count) wp_insert_post(array( ‘post_name’ => ‘contact’, ‘post_title’ => ‘Contact’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’, ‘post_author’ => 1, ‘page_template’ => ‘page-contact.php’, )); unset($contact_query); What does it do? If the contact page … Read more

Latest post in a specific menu

Yes, this is possible: function latest_posts_menu($items, $args) { //To a Specific Menu if ($args->theme_location == ‘primary’) { // Parent Menu Item $items .= ‘<li id=”menu-item” class=”menu-item”> <a href=”#”>’ . __(‘Latest Posts’, ‘textdomain’) . ‘</a> <ul class=”sub-menu”>’; // Create Sub Menus foreach ( get_posts( array( ‘posts_per_page’=>10, ‘post_type’ => array(‘post’) ) ) as $post ) { // … Read more

Get custom post type list for every category shortcode

You are not dealing with categories. You are dealing with a custom taxonomy. $postlist_args = array( ‘posts_per_page’ => -1, ‘offset’ => 0, // ‘category’ => $category->cat_ID, // not this ‘tax_query’ => array( array( ‘taxonomy’ => ‘cars_category’, ‘field’ => ‘id’, ‘terms’ => $category->term_ID, ) ), ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘msccar’, ‘post_status’ => … Read more

Adding an Options Page to a Plugin

@AndrettiMilas, If you really need a top level menu item (which is not encouraged), you should use add_submenu_pageinstead of add_options_page. Please refer to the Codex for the required parameters. You could add the submenu like: add_submenu_page( ‘wlseo’, ‘Submenu 1’, ‘Submenu 1’, ‘manage_options’, ‘wlseo-submenu-1’);

Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?

Unfortunately, this is not possible, at least not safe. The function wp_insert_term( $term, $taxonomy, $args = array() ) that handles the creation of taxonomies provides a few filters and hooks, but the only one before the creation of the term in the database is $term = apply_filters( ‘pre_insert_term’, $term, $taxonomy ); As you can see, … Read more

WordPress add post format support not working

Add this to your child theme which over-rides what your parent theme supports. Post Formats for Posts add_action( ‘after_setup_theme’, ‘wpsites_child_theme_posts_formats’, 11 ); function wpsites_child_theme_posts_formats(){ add_theme_support( ‘post-formats’, array( ‘aside’, ‘audio’, ‘chat’, ‘gallery’, ‘image’, ‘link’, ‘quote’, ‘status’, ‘video’, ) ); } And here’s the result tested on the Twenty Twelve default theme. You can also use the … Read more