<?php
$metacatname = get_post_meta( $post->ID, 'related blog articles', true );
if(!(empty( $metacatname ))):
$my_query = new WP_Query( array(
'category_name' => $meta_cat_name,
'posts_per_page' => 5,
) );
if ( $my_query->have_posts() ):
while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<a href="https://wordpress.stackexchange.com/questions/29266/<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php
endwhile;
endif;
endif;
wp_reset_query();
?>
Related Posts:
- Query to sort a list by meta key first (if it exists), and show remaining posts without meta key ordered by title
- Individual Widgets per Page
- Add custom fields to search
- How to add add_meta_box to specific Page Template?
- Apply the_content filter to a custom field with multiple values
- How to get users by a custom field / by user meta data?
- Auto sort the wp-admin post list by a meta key
- Adding another state (spam, reject, approve) to wordpress comments?
- Filter archive.php by custom meta
- Get updated meta data after save_post hook
- Add custom field to image editor
- Show User Their Password
- TinyMCE in Custom Metabox not loaded after upgrading from WP 3.1.4 to WP 3.2
- How to reload the role specific registration form on validation errors?
- ajax delete value from custom field array
- How can I sort get_users() by any value (last_name, user defined fields and more)
- Custom field for default gallery
- After moving my site from a dev subdomain, to root, all my custom meta data is gone
- Currency (price) formating on custom fields
- Gravity Forms: Create fields programmatically
- WordPress Custom Field Should be Unique. Is it possible?
- all tincymce’s switch when updating page after changing from html to text in custom metabox
- Order by value in serialized custom field
- Custom image sizes for custom field media uploads
- Author Page Custom Query WHERE author OR [post meta value] OR [post meta value]
- converting custom field date format
- Add source URL from Feed WordPress (Syndication) plugin to a custom field in post editor
- List custom taxonomy terms from custom field
- How do I create a column in Users list and display user data from custom registration field
- Better Method for Multiple Meta Boxes
- Possible to add a meta field for css attribute to the editor Advanced panel?
- Product Custom Fields with HTML and JS
- Add new image block, set default class name and update it using Javascript
- Add image to menu item with ACF
- Client PDF Upload (Catalogue) – Automatically update link to PDF
- How to create a shortcode to print specific values stored in a post meta array?
- Button inside Custom Meta Box triggering the Update Button
- How to load an assets based on custom field value?
- Adding auto-complete to custom gravity field not working
- Search in Archive Pages by subcategory, tag, custom field and year
- Custom WP_Query for WordPress Search Results with meta_query
- Change order of posts
- Meta Query And/Or
- URL Rewrite fires when retrieving a custom value?
- How to store post meta in an array
- Get image url using image id
- Set checkbox as checked by default in a metabox
- ACF form edit front end post title does not change permalink
- Can I use a Custom Field as the Featured Image URL?
- Using a custom field inside a shortocde
- Add Custom Profile Field as Notes
- Copy price categories to custom field
- Sanitize user input fields before wp_insert_post
- Use Advanced Custom Fields – replace line of code that hardcodes the tag into the template
- Increment user meta data by 1 each time a page is visited
- Advanced Custom Fields and Post Meta Fields Relation
- Woocommerce frontend edit custom fields
- Can’t Output get_post_meta?
- Displaying an ACF list of users
- Meta value Array
- KEY and VALUE custom field issue
- using custom fields on content.php file of my theme
- Hide / Show Custom field depending of the page ID (Magic Field 2)
- How to show certain data on certain interval of period
- How do I include a template file while allowing it to render its own dynamic content added via custom box?
- Stripping and/or altering the content of a custom field (video URL)
- Custom field outside the loop and inside an array
- Users uploaded image and matching an id or taxonomy
- Adding data to User profile
- How can I change author of posts to the value of one of the custom field of the posts?
- Let any visitors delete a post if they know Id nr & password?
- Is it possible to add Term Meta Fields to a WooCommerce Attribute?
- update a custom field with the value of another existing custom field
- Post meta data not showing in frontend, until hitting ‘update’ button
- Ordering posts by custom fields (Date)
- register_form, custom field not submitted on first try
- PHP and Shortcode Combination
- Retrieving Advanced Custom Field within Shortcode Function [closed]
- How to properly get popular Posts by multiple Values
- Query Custom Fields in Searchform
- Make custom user_meta as permalink for post
- Creating Structured Documents (books) in WordPress?
- Filter query based on date in custom field
- Get custom fields when hover link of post
- WP Query multiple select form – meta_query help
- update_post_meta not working in action hook
- Group pages by custom field values
- Convert many posts from having a specific meta_key to use a post_format
- Custom fields: my custom checkbox area doesn’t seem to work
- get_post_custom_values not working
- How to check if custom field exists in this widget query
- display loop only if a post meta data exist
- Add Custom field under the post title [closed]
- Check if a field is capitalized?
- Can’t sort custom column on user.php by number / meta_value_num?
- Need to call this php function inside a modal window from text widget
- add multiple values (array) to post meta_input
- Assign class to Drop Down Selections in WooCommerce Products Custom Fields
- Multiple permalinks for a single post from custom field
- Search for meta_query does not return any result if combined with title