roadtrip
Forum Replies Created
-
Forum: Reviews
In reply to: [BlankSlate] Why Blank Slate Rocks!I completely agree! I build my sites from scratch in HTML, then I use Blank Slate to create my custom themes. It’s so awesome.
Question: I use Classic Editor and ACF with Blank Slate, which works like a charm. Some clients, however, come to me with the Gutenburg Block Editor, which I struggle with. Which workflow do you typically use, Classic or Block?Oh, hold the phone. It seems to be populating slowly now. Whew. But why didn’t my images migrate?
Forum: Fixing WordPress
In reply to: Query of custom post type to call post with conditional termUpdate: I did find a solution that I would like to share.
I created 3 templates: taxonomy-gallerynames-A.php, taxonomy-gallerynames-B.php, and taxonomy-gallerynames-C.php. In each template was basically all the contents from single-galleries.php, but with queries for the different terms (gallery names) in each.
Then, I found this magical code to put into the archive-galleries.php page, to call the term templates:
<?php the_terms( $post->ID, 'gallerynames', ' ', ', ', ' ' ); ?>
Once I popped it into my archive template, I realized what it does. It displays a link that calls my taxonomy-gallerynames-term.php templates! Yay all was right with the world! So I replaced the permalink code, which you would normally use to link to your custom post, and that’s how I got it to work.
Question, though: Do permalinks not work with taxonomies?
And further question: How can I make the above code display something other than the TITLE as a link? Because I want the link to say, “MORE DETAILS”. Seems like it would be so simple but I can’t find the answer.
Tried adding a description on each called ‘More Details’ then modified the code:
<?php the_terms( $term->description, gallerynames', ' ', ', ', ' ' ); ?>
but it doesn’t work.
Although this solution works like a charm, I’m still left wondering if there could be a step I could save by making only ONE taxonomy.gallerynames.php template and calling each gallery name (term) with a conditional statement. For this project I only have 3 gallery names, but what if I had 30? Would I have to create 30 new templates for each?
Anyway, if anyone could shed light on this, that would be swell. ANd I hope my solution helps anyone out there who is as desperate for a solution as I was!
Cheers!
Forum: Fixing WordPress
In reply to: wp_query custom post type with conditional termsGetting closer. I added the taxonomy argument and got the speakers list to display, but they all display, instead of according to term associated with each. Here’s the rev:
<?php $the_query = new WP_Query( array( 'post_type' => 'speakers', 'taxonomy' => 'event-names', 'orderby'=>'title', 'order'=>'ASC' )); ?> <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); if ( has_term( 'embedding', 'event-names' ) ) { echo get_sidebar('embedding'); } elseif ( has_term( 'reorganizing', 'event-names' ) ) { echo get_sidebar('reorganizing'); } elseif ( has_term( 'accountability', 'event-names' ) ) { echo get_sidebar('accountability'); } else { // catch-all for everything else (archives, searches, 404s, etc) echo "<p>That's all.</p>"; } // That's all, folks endwhile; ?> <?php endif; ?> <?php wp_reset_query(); ?>
Forum: Fixing WordPress
In reply to: Query of custom post type to call post with conditional termI tried to call different sidebar templates with conditional statements, but it’s not working and I’m not sure this is the correct syntax:
<?php if ( has_term( 'a', 'gallery-names' ) ) { echo get_sidebar('artists-a'); } elseif ( has_term( 'b', 'gallery-names' ) ) { echo get_sidebar('artists-b'); } else ( has_term( 'c', 'gallery-names' ) ) { echo get_sidebar('artists-c'); } ?> <?php endif; ?> <?php wp_reset_postdata(); ?>