What is the correct term for a tool that filters content based on metadata?

After additional research, the answer appears to be that the term “taxonomy” encompasses the two sorting tools most common in WordPress. Those are categories, which can be hierarchical, and tags, which cannot have a parent-child relationship. A simple example would be a custom post type called cafes in which you might have parent categories such … Read more

Custom wordpress loop

You can set your custom loop something like this $a=2; //In while loop counter increments by one $counter++ if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); if($a%3!=0){ //Here write function to display title and discription ?> <div class=”col-md-4 col-sm-6″> <div class=”cp-attorneys-style-2″> <div class=”frame”> <a href=”https://wordpress.stackexchange.com/questions/263067/<?php the_permalink(); ?>”><?php the_post_thumbnail(”); ?></a> <div class=”caption”> <div class=”holder”> <ul> … Read more

How to convert custom fields to content

You can do this by using something similar <?php //Post we need to update $id = 37; $custom_field = get_post_meta( $id, ‘custom_field_key’, true ); // Update post 37 $mg_post = array( ‘ID’ => $id, ‘post_content’ => $custom_field, ); // Update the post into the database wp_update_post( $mg_post ); //Delete the custom field delete_post_meta( $id, ‘custom_field_key’ … Read more

Display Custom Post Types Glossary

I used this code to create a glossary for a custom pos called “store”. So you can use it just replacing the “store” by “book”. Put this code in the loop of the page template you will be using for the glossary. $last_char=””; $args=array( ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘posts_per_page’=>-1, ‘post_type’ => ‘store’ ); … Read more

How to add new post using a form to categories when categories are using as menu

The post_category parameter has to be an array, try this: $post = array(‘post_type’=>’post’, ‘post_author’=>$author, ‘post_status’=>’publish’, ‘post_title’ => ‘Test Title’, ‘post_category’ => array(‘679′) ); Ref: http://codex.wordpress.org/Function_Reference/wp_insert_post#Parameters If that doesn’t work for you, try using category_name: ‘category_name’ => ‘category_name’,

Get post format

If you’re outside the loop, pass a post ID. $format = get_post_format( $post_id ); To guard against missing formats, add a default to your template: $format = get_post_format() ? : ‘standard’; Then you can use your same IF statement: if ( $format == ‘link’ ) :