Enabling post thumbnails for custom post type

You are most probably using add_theme_support() in the wrong context (hook). Because you are registering the post type yourself, all you need to do is to add support for thumbnails in the supports array when you pass your your arguments to register_post_type() supports (array/boolean) (optional) An alias for calling add_post_type_support() directly. As of 3.5, boolean … Read more

Programmatically Create Category and sub Category

If your question if like this: Category A – sub-category 1 – sub-category 2 – sub-category 3 Then you would create the following in your theme’s functions.php: //create the main category wp_insert_term( // the name of the category ‘Category A’, // the taxonomy, which in this case if category (don’t change) ‘category’, array( // what … Read more

WordPress Redirect: Default Password Reset URL [duplicate]

There is a filter to change the lost password url. Try this : add_filter( ‘lostpassword_url’, ‘my_lostpassword_url’, 10, 0 ); function my_lostpassword_url() { return site_url(‘/password-reset/’); } Note : You can place code in functions.php or make plugin (Recommended).

posts_per_page not working

The problem with the second query is due to the way that the parameters are passed. In the original code, two strings are being passed, which is not going to work: $the_query2 = new WP_Query( ‘cat=10’, ‘posts_per_page=1’ ); You can use an array (preferred method): $the_query2 = new WP_Query( array( ‘cat’ => ’10’, ‘posts_per_page’ => … Read more