If you are creating artists as categories then their single page template will be category.php , in category.php add the following code :-
$category_id = get_cat_id( single_cat_title(“”,false) );
$cat_name = get_cat_name($category_id);
$new=query_posts(‘post_type=news_album&cat=”.$category_id.”&post_status=publish&orderby=ID&order=DESC&posts_per_page=-1’);
if( have_posts()) : while(have_posts()) : the_post();
echo get_the_title($post->ID);
echo get_the_content($post->ID);
endwhile; else: echo “No posts added for this category!”; endif; wp_reset_query();
Related Posts:
- WordPress Paginate $wpdb->get_results
- Custom Search Query
- Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123
- Retrieve and display data from custom db table in admin area?
- How to find if a post with custom_field == X exists?
- Custom search page and search by title, content and tag
- Modifying loop on a custom page, strange behaviour
- How I display post of the post type group by year of post?
- Load more posts with multiple queries
- Hi, I wanted to make custom search with multiple fields
- $wpdb->replace: WHERE?
- wp_query get post custom taxonomy in search.php
- Order posts with a custom field but also without
- Save title as custom field on custom post type
- Add content in between of foreach
- Custom Loop Query For Search Page
- Custom SELECT Query With Multiple Meta Values (Ordering Problem)
- Query for specific custom field
- Display posts by combining multiple meta key
- Custom select query two tables by a meta key
- Custom Same Page Search
- Fatal error Call to a member function insert() on a non-object [closed]
- custom user meta query
- Recent activity query WordPress
- How to query term_id of a Custom Taxonomy by name
- WP Search Form Query: Add Author’s posts into search query
- query variables for custom taxonomies
- display text generated via custom get query string
- Custom query pagination with php parameter as arg problem
- How to automatically pull an information from a form field onto an other page?
- Query 1 custom post type, each day, alphabetically
- Multiple Taxonomies Using Custom SQL Query
- Search a meta field for a value in all posts
- Custom WordPress SQL Query 4 posts per custom taxonomy
- Custom MySQL query to list post
- Custom Query Arguments
- Custom Query for Taxonomy
- Include plugin´s table in custom query
- User Query Multiple Orderby Clause
- Best Practices for Regression Testing WordPress Websites?
- What is true chmod for WordPress?
- wp_trim_words() does not trim the_content() in WordPress
- Adding Custom Fields to WordPress Comment Forms?
- Gallery Shortcode: using link attribute to link to a specific image size
- Getting $comments outside the comment template
- get_theme_mod(); returns nothing
- Limit comments displayed on basis of user_id
- Find and replace domain name on the fly?
- What is the most idiomatic way to let clients edit phrases in HTML?
- How to Register and Display Widget for Custom taxonomy
- How to change “Dashboard” text in wordpress
- Image Editor does not affect custom sizes!
- How to access my php page in wordpress
- How to display post title & excerpt when mouse hovers on an image?
- How to fix the IE9/WordPress Twenty Ten Header Image Display Problem?
- Automatically add image caption with values from a post parent field?
- What changes we need to make to a theme so it can be installed as a MU Theme?
- Get Custom Logo Alt Text
- How would you implement a CTA infront of a videoplayer? [closed]
- How can I get the custom post type assigned to a current custom taxonomy for query?
- Unable to edit the “customize” section and the “widget” section is populating unknown code
- Can’t receive $args[ ] to my custom widget
- Blog page problems
- What WordPress Hook Is Used Before Signup Data is Saved?
- One WordPress install for main site at domain.com and blog at blog.domain.com?
- Installing new theme on running site
- Combine two conditions in one statement syntax [closed]
- Is there a way to add a new value into a stored custom field value?
- dbDelta not creating tables with composite keys
- Customizing Users in Admin Area
- Good way to customize admin CSS?
- Add table to WordPress database
- get_delete_post_link( $post->ID ) is blank when logged in as “subscriber”
- Menu not appearing in custom theme
- How can i display custom menu in sidebar?
- How to redirect the home page to a custom page?
- Make the home page template my archive/category page template without code duplication
- How to create multipage form and redirect to specific URL based on inpput?
- WordPress 5: including larger thumbnail image sizes in srcset than I have set
- remove screenshot.png via dashboard
- Add to search posts query array with post IDS which will appear first
- Send default WooCommerce email when switching from custom order status
- Translate site in own text-language [closed]
- Pull A Single Post Prior To Running wp_query
- Build custom pdf from users choices
- How to work around the bug which prevents custom menus from being deleted?
- Changing a setting in the wp-admin/customize.php reverts CSS styles to parent theme [closed]
- Create a folder if it doesn’t already exist
- Special Query: Title, Terms, Content – %LIKE%
- Changes in comments.php in the child theme does not show up on the site
- How to remove the tagline from the HTML ?
- Custom table or form
- how to modify request to get_template_part()?
- Getting Custom Field value in WP_Query
- Adding Custom HTML/CSS/JS code in specific page
- Custom template not working for existing pages [closed]
- Adding Telescope / Meteor App to existing WordPress site
- Help needed renaming custom post
- Disable all Fonts that are Standard in WordPress and replacing them with a custom Font?
- Custom product sorting archive page