This should work. Just make sure that meta key is Project ID
.
function projects_posts() {
global $post;
$project_posts = get_posts( array(
'post__not_in' => array( $post->ID ),
'category_name' => 'team-resources',
'meta_key' => 'Project ID',
'meta_value' => get_post_meta( $post->ID, 'Project ID', 1 )
) );
$output="<ul>";
foreach ( $project_posts as $project_post ) {
$output .= '<li><a href="' . get_permalink( $project_post->ID ) . '">' .
apply_filters( 'the_title', $project_post->post_title, $project_post->ID ) .
'</a></li>';
}
$output .= '</ul>';
return $output;
}
Related Posts:
- New WP_Customize API – how does it work under the hood?
- Data sanitization: Best Practices with code examples
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- How to include own css on wordpress tinymce editor?
- how to override woocommerce specific loop or archive-product.php [closed]
- How to Add Customizer Setting in Child Theme
- When adding a custom REST endpoint, where do you put the endpoint function, and where do you put the function registration call?
- global menus made from master site’s custom menus wpmu network
- Capability to edit own posts and not others
- Make page template that is just an “include” of another?
- Is there a way to create invisible pages?
- How to handle security on a wordpress site? [closed]
- Which freelance sites are recommended to find WordPress developers/programmers, etc
- Count widgets of a certain type
- Custom widget select options needs to stay selected after save
- Syncing Avatars across multisite
- How to move the wordpress site from test url to main url? [duplicate]
- How can I get the intended URL in a 404?
- Creating user relationships
- Multiple sites/domains with content all managed by single installation of WordPress
- Paginate Author’s Post List on Custom Author Page (ANOTHER THEORY)
- How to change email address used for registrations?
- Loop through custom fields with similar label / common chars in label
- title, content, feature images
- How can I make site-wide content editable, for example footer content
- Custom Facebook share button with custom title,url,image in wordpress
- Sort posts by multiple meta key values
- I want to submit multiple users if checkbox is checked
- How Do I Remove The Right Hand Block On The Main Header?
- Category selectable homepage
- Create custom dashboard for Multisite admins
- Add custom profile field only for site admins?
- Alphabetical Custom Menu
- Integrate wordpress into index page
- Highlight comments of all the site authors
- Creating custom database table with crud operation
- Development environment
- Allow guests to use WP Customizer but disable save button
- Can I add/replace the WordPress image in the Dashboard
- Adding comments to my custom theme
- Add content in between of foreach
- How to insert a writing panel between the title and the page content?
- Woocommerce product permalink not working
- Show custom message/info for authors in add/edit post page
- create Custom field for tv series
- Data won’t save if metabox within conditional in admin. What am I missing?
- Restrict Viewing of post on both front and backend?
- I w’d like to know If there are simple solutions to integrate other CMSs to wordpress
- add_feed rewrite overwriting standard permalinks
- Create a page that dynamically loads data
- Editing a post template
- Gravity Forms – gform_field_value – query custom table breaks functions.php
- Customizer – How to get theme mod range value?
- Let author add field to metabox by pressing a button
- Date Ordered Archive Page for single category?
- GUID URL Question
- Usage of custom post types in a custom admin menu
- How to set up conditionals in page templates?
- How do I change my permalink structure to a custom structure on an established blog?
- How to create social Share Buttons Without Plugin
- Customize Widget Navigation
- I found this code to be very useful, how can I change it to a text that display “Product versions and period of last update” rather than a button?
- Select input in metabox not updated
- display text generated via custom get query string
- Add admin page for specific post status (for example)
- Bootstrap slider not working
- How can I style the Comment Section of a blog post
- Custom Meta Box: Value saved in WordPress DB, but not shown in input field on Edit Screen
- Custom post-type working except for Selecting page-parent
- How could I change contact details in the footer?
- Editing a website made with wordpress
- How do I make elements in mobile only reverse order?
- Cannot replace header & footer using “the_content”
- Custom Route Returns 301/Passing Variable from Input
- Menu selection for header
- How to display custom admin pointers (tips/notifications) in Dashboard until dismissed?
- Custom password set/reset link in same URL format as default does’t work
- Two color in one Heading
- Creating custom setting in add media popup
- Still desperate about multiple TinyMCEs in widgets – is there any good solution to this yet?
- Upload image without resizing but insert in post with resizing
- Expressions and str_replace
- How to create a new blog in wordpress?
- Best way to move a site to a subfolder for testing purposes?
- Wonderflux Framework Static Homepage
- How to customize theme?
- Creating Action Hooks For Automatic File Inclusion
- Secondary loop doesn’t work
- Custom user fields validation on registration
- Pre_Get_Posts order DESC not registering
- Adding pages to the Admin panel
- Setting Custom WordPress “Posts page” AS “Front page”
- Share user access between two wordpress sites
- What capability is required to view posts, scheduled in the future, by someone else?
- Custom Query Arguments
- Adding page Title in a custom coded page
- Reached end of document without finding – using mod_pagespeed
- Gallery Pagination by Row
- use another theme for just one page