Get Categories & Posts With Type Article

I solved this with following code: $currentCategoryId = wp_get_object_terms($post->ID, ‘article-category’, array(‘fields’ => ‘ids’)); if (is_array($currentCategoryId) && !empty($currentCategoryId[0])) { $currentCategoryId = (int)$currentCategoryId[0]; } $cat_args = array( ‘taxonomy’ => ‘article-category’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘hierarchical’ => true, ‘parent’ => 0, ‘hide_empty’ => true, ‘child_of’ => 0 ); $get_categories = get_categories( $cat_args ); $categories = array(); … Read more

Set featured image on creating new post

Ok, it’s my fault. I’ve installed a “blank”-theme to have a blank frontend (because I only use the API) – but I didn’t realize that a theme changes something in the Admin Frontend. By adding this to the functions.php I re-enabled the box: add_theme_support(‘post-thumbnails’);

Dynamically load posts based on category

No there is no such premade code to load posts based on which categories are selected without reload the page content. There are two option you can imply. Option 1: Using Ajax Option 2: Loading all the content and hide/show using CSS & jQuery tricks Note: Option 2 increase your initial load time as you … Read more

WordPress for business site

Create a new page from the wordpress menu, then go to settings->reading->a static page and choose the page you just created: this page will be the main page when you visit the website.

Multiple Custom Post Type with different Taxonomies

Try this: function post_type_categories() { $field_args = array( ‘labels’ => array( ‘name’ => ‘Categories’, ‘taxonomy general name’, ‘singular_name’ => ‘Category’, ‘taxonomy singular name’, ‘search_items’ => ‘Search categories’, ‘all_items’ => ‘All categories’, ‘parent_item’ => ‘Parent category’, ‘parent_item_colon’ => ‘Parent category:’, ‘edit_item’ => ‘Edit category’, ‘update_item’ => ‘Edit category’, ‘add_new_item’ => ‘Add new category’, ‘new_item_name’ => ‘New … Read more