OK, so you have to modify some part of your code like so:
$list=" ";
while ( have_posts() ) {
the_post();
$terms = get_the_terms( $post->ID, 'port_tags' );
$terms_string = '';
if ( $terms ) {
foreach ( $terms as $term )
$terms_string .= $term->slug . ' ';
}
$list .= '<li class="mix all '. $terms_string .'">'
. '<div class="listing-content">'
. '<h3><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>'
.'<p>' . get_the_excerpt() . '</p>'
. '<a href="' . get_permalink() . '">' . 'View »' . '</a>'
. '</div>'
. '<a class="listing-thumb" href="' . get_permalink() . '">' . get_the_post_thumbnail($page->ID, 'listing-thumb') . '<span></span></a>'
. '</article>'; // <- it should be </li> not </article>, I guess - you don't open any <article> tag in this loop
}
Related Posts:
- Create a shortcode to display custom post types with a specific taxonomy
- Generate Shortcodes by Taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Custom Post Type Loop within Shortcode
- Display Recently Added Custom Post Types with Custom Taxonomy Shortcode
- Get custom post type list for every category shortcode
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Display CPT Category List as Shortcode
- Custom post type shortcode with taxonomy attribute not working and no errors
- Shortcode in excerpt
- Plugin Error on activating
- Shortcode display CPT Query only showing 1 post?
- How to Create Short Code Using Custom Post type
- trying to display custom post type with custom taxonomy value by shortcode can’t works [closed]
- Problem with shortcode
- Add Shortcode functionality to a function that queries custom post type / taxonomy
- Add category base to url in custom post type/taxonomy
- Display all posts in a custom post type, grouped by a custom taxonomy
- Ordering Posts List By Taxonomy Terms?
- Templates for Custom Post Types and Custom Taxonomies
- WordPress Custom Post Type Category Page
- post count is wrong when using same taxonomy for 2 different CPT
- Issues when rewrite rules collide?
- Add links to post categories and taxonomies in wysiwyg link modal?
- WordPress Custom Shortcode Conflicting with Media Library
- Archive page for taxonomy of custom post type
- CPT tax slug conflict with post type slug
- Custom post type archive with dynamic taxonomy filtering – is it possible
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Custom Taxonomy Breadcrumb Navigation
- Remove “-2” from a Toolset Types URL with the same post name
- Exclude current post when getting related post on custom post type and taxonomy
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Is it possible to make tag archive page specific to Custom Post Type?
- Multiple portfolios with one custom post type?
- Custom Post Type and Taxonomy combination
- How can I display my custom metaboxes on a custom post template?
- How to specify URLS for custom posts & taxonomies
- Taxonomy.php Not Showing Posts
- How to check the terms in single custom post type template
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Add category attribute to custom shortcode
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Posts from all the categories are being displayed instead of particular category
- Categories sorting
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Allow user to set custom order to a list of custom taxonomies?
- Disable block with taxonomies at post page
- search also in taxonomy, tags and custom fields
- Custom Post Types, URL rewrite on multiple CPTs
- Sort and filter custom post type posts by custom taxonomy
- Terms showing up in object cache on unrelated pages
- Plugin fatal error
- Template to list categories in custom taxonomy
- Is there something like has_no_term
- Which Template Page Should I Use?
- Display different information of a custom post type
- I can’t access custom taxonomy page listing
- Should I use custom taxonomies or not?
- List of Categories for Custom Post Type
- Attaching a Custom Taxonomy to Posts?
- display custom taxonomies limited to custom post type?
- Reordering admin columns for CPT with custom taxonomy and an added custom field
- The Difference Between Categories and Tags and Taxonomies and Terms
- Category Search / Custom Post Type search on my website. Custom Post Types that are “page-like”?
- How to get the post terms from a child taxonomy
- display posts of custom post type with custom taxonomy
- Display registerd taxonomy in admin dashboard
- Shortcode / WP_Query in post changes context
- Check category_name or taxonomy slug for a Custom Post Type?
- Help on Custom Post Types
- How to display post from one custom post type in another custom post type with the same taxonomy?
- how to achieve this permalink abc.com/CPTName/CustomPostTypeCategorySlug/categoryname
- How to display list of custom post taxonomy terms and their posts (if any)?
- Alike Shortcode using in Custom Shortcode
- have to do a while have post to show for two custom post types sharing the same taxonomy?
- Remove custom permalink base from CPT custom category and custom tags
- How to handle this wordpress custom post type rewrite problem?
- List taxonomies by post id
- How do i display all categories of a custom post type and have respective page for them?
- Is it possible to arrange Custom Post Types from CPTUI into a Folder?
- Issue with Custom Post Types and Permalinks
- Automatically Add a default category to a Custom Post Type before save_post action
- Add active class to foundation 6 tabs while looping categories
- Get list of all Topics in use by a custom post type
- Custom post types with child taxonomy not visible in admin
- 404 error next-page [2] PageNavi custom type taxonomy
- Filter By Term Not Working – Custom Post Type
- Custom post type category archive URL redirects to home page
- How to display category wise posts on seprarate template
- Organizing The Custom Post Type with Taxonomies / Parent Posts
- show custom taxonomies in hierarchy
- Display 2nd category, only once, as sub-heading, in the loop
- Display Custom Post Type in Custom Taxonomy URL
- Listing custom post type items from a couple of custom taxonomies
- Catergory args causing loop not to show
- List custom taxonomy terms
- How to pull a number posts from a specific Taxonomy within a Custom Post type
- Title- Custom taxonomy by using get_term
- Assign Default Taxonomy to Post When Created