I think you can add an class to the [post_class()][1]
function via Filter; the name, the string can you use form different values: tags or post title?
The follow example use the title of post and add this to the classes of post; if you use the post_class()
function on post tag in markup. Also you can use other values for design this.
function fb_title_post_class( $classes ) {
global $post;
$classes[] = sanitize_title_with_dashes( get_the_title( $post->ID ) );
return $classes;
}
add_filter( 'post_class', 'fb_title_post_class' );
Related Posts:
- Best way to style first post differently?
- Custom post type loops with different page templates
- How do you output custom code between posts in the loop?
- How would I create a shortcode to display a custom post within a page or regular post?
- Shortcode not working with post counter
- Loop increase number
- Get post format
- posts within custom post type all share the same content in the front-end
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Pagination not working in custom post type. Help
- subtracting the current post form then whole loop, which is generating all CPT titles
- Where paramaters of a custom function are coming from inside the loop?
- Pagination not working with custom loop
- wp_pagenavi() with custom wp_query()?
- how do I group content in magazine-style ‘issues’?
- How do I add a custom post type to the Featured Content in twenty fourteen theme?
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- 404 error PageNavi custom type taxonomy | wordpress
- Multiple Content Block
- Query for posts in 2 taxonomies
- Allow Users Access to Custom Post Type Only
- How to get Custom Post ID by adding filter to child theme’s function
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- When ‘is_post_type_archive()’ return true?
- How to check if “is single” page
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- How To Enable Block Editor (Gutenberg) for Existing Post Type via functions.php
- Using pre_get_posts to filter one loop in a multiloop archive
- Custom Post Type Loop within Shortcode
- Create a post in custom post type using field in registration form after users submit form
- right_now_content_table_end function not working?
- Display CPT posts based on specific taxonomy
- Meta Key Value in current-user-only loop
- CPT + CMB2: data not displaying for only first post in loop
- Loop custom taxonomy to get lists of cutom post types?
- Show a Category X’s custom post type on Category X archive page?
- Sort by alphabetical order archive.php page
- How to target a specific custom post type post and its all children and grandchildren?
- ACF field key/value to show on taxonomy list
- Re-registering a custom post type not working (not showing up)
- How to make custom posts types display when published for the future
- CPT archive admin menu label
- WP Query with categories only shows one post and ignores the category
- Post ID randomly printing on page
- How do I know the ‘meta_key’ for ordering my custom post type
- Different Category system needed for the Custom Post Type
- Sort posts in loop by the WooCommerce Membership of the author
- Featured Image field not appearing in Custom post type
- How to include custom post type posts on a page?
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Custom post type showing same Post on all Pages
- List of all entries of custom-post-type: Add year-parameter?
- get parent content inside child posts
- Removing full title and breadcrumb header container for a specific post type
- display posts of custom post type with custom taxonomy
- assign different templates to custom post type with homepage loop
- Custom Post Type and Taxonomy Loop Output Is Wrong
- foreach loop inside the loop creating duplicates in output
- Display author box on just certain category posts?
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- CPT archive page – show one post from each taxonomy term
- How do i display post from a taxonomy term?
- Custom loop request based on custom field
- If/Else child list for Custom Post Type single template within loop?
- Insert a Custom Post type into my Loop
- Custom Post Types Not Showing Up In query_posts Result
- Do I need a loop to display an object that attached to posts?
- “Order” doesn’t work in custom loop?
- redirect after submiting post for review
- How to divide Subcategories into pages of parent category wordpress
- update custom taxonomy custom fields
- Shortcode with loop stacks output
- how to display author name in custom post type
- Show custom post type event if current day using ACF
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- How to output and alert message when updating a post
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- Create dynamic logo carousel without using any plugin
- sorting in wp query based on custom field value
- Custom post type loop without children
- How to display user-defined / custom post in wordpress?
- WordPress loop add heading before first of type
- Only show current category post
- Looping through custom taxonomy in one template
- get_post_meta for Custom Post Type ( CPT )
- Featured image in custom post is being disabled
- Is it possible to add query parameters on the archive page?
- Custom post type archive pagination with HTML5Blank theme?
- WordPress loop for multiple custom post types
- Pagination not working with custom loop
- Fallback if statement based on the number filtered from it
- Create custom post order (with custom post type meta)
- Pagination not working with custom loop
- Noob Loop Question
- show custom post’s post in two different divs [duplicate]
- Limit wordpress posts loop to continue onto another page
- WPNavi pagination links not working on custom pages
- How to use wp_set_object_terms depending on page ID?
- Group search results by post type, but having a unique heading for each section?