1202 comments found

  • Bought between 1 and 9 items
  • Has been a member for 1-2 years
  • United Kingdom

Please help. I have seen several other people asking the same question I’m about to ask but no replies were posted.

I want to build 3 pages, each one displaying artists of a particular category (daytime, speech, specialist). When I create a new page with the Artist Style 1 or Style 2 it displays every artist in the database, giving me no option to display only a particular category of artists.

I know that I can create a blank page and use the shortcode [artists cat=category_name] but (as somebody else here has pointed out) it only returns 3 entries – and also the styling is messed up, it doesn’t fill a whole page like the Artist1/2 styles do.

Please somebody help me to achieve what i’m looking to do by building separate pages each returning artists of a particular category.

I’ve spent hours digging through the php functions and queries behind this but I can’t make sense of it.

Thanks

Default-user

I’ve figured out a workaround on my own. Hopefully anyone else looking to create multiple artist pages based on different artist categories can find this useful. I presume it’s not the tidiest of workarounds as it involves duplicating your chosen style page:

My artist categories are ‘daytime’, ‘specialist’, and ‘speech’.

- I opened my chosen style page (I’m using artist-style1.php).

Then I changed this (Line 30). ‘term’ seems to relate to a category name. I could be wrong, but I don’t know PHP very well.;
'term' => $term
...to this;
'term' => daytime
Then at the top of the file I changed the template name to reflect which category this file queries;
<?php
/*
Template Name: 4 Column DJ/Show Grid: Daytime
*/
?>

That last change means that this style option will now show up with the correct name that I can recognise in the template dropdown when creating a new page in wordpress.

Then all I had to do was copy & paste the contents of artist-style1.php over twice into artist-style2 and artist-style3.php (a new php file) while making sure to change the ‘term => category’ to my desired artist category.

Thanks

Default-user

Oh, and I saw that somebody else asked how to order results alphabetically by name. You’ll want to add these lines into the query in your chosen style page (I’m using artist-style1.php as an example):

Change this;
$query     = array(
    'post_type' => 'artist',
    'posts_per_page' => $artists_nr,
    'paged' => $paged,
    'taxonomy' => 'artists',
    'term' => $term
);
to this.
$query     = array(
    'post_type' => 'artist',
    'posts_per_page' => $artists_nr,
    'paged' => $paged,
    'taxonomy' => 'artists',
    'term' => $term,
    'orderby' => 'title',
    'order' => 'ASC'
);
  • Bought between 1 and 9 items
  • Has been a member for 2-3 years

Is it possible to order galleries by release date, most recent first?

by
by
by
by
by
by