WordPress – display relationship between blog posts and custom posts

Below is the updated code to fetch posts, please check is that helpful: $documents = get_posts(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => ‘our_people_author’, // name of custom field ‘value’ => ‘”‘ . get_the_ID() . ‘”‘, // matches exaclty “123”, not just 123. This prevents a match for “1234” ‘compare’ … Read more

Get category name of custom post type

The following code should return you the correct category names, however I am not clear what you’re actually trying to achieve. I think you’re using the foreach loop in wrong way. Are you trying to add all the category names as css classes for the div or something else? <div class=”row masonary-wrap”> <?php $args = … Read more

Add Link to PHP message

Add this Code in your function.php file function mito_login_message( $message ) { if ( empty($message) ){ return “<p><a href=””>hyperlink</a> Please login to continue</strong></p>”; } else { return $message; } } add_filter( ‘login_message’, ‘mito_login_message’ );