Support » Plugin: Query Multiple Taxonomies » Getting Title With Commas

  • Currently, my WordPress installation is using the Archive.php template for the results of this plugin. The problem is that when you get to the page, both the page Title and the page h1 are just the first queried variable, and none of the other ones. I am using

    <?php $term = $wp_query->queried_object;
    echo $term->name; ?>

    But as far as I understand, that just returns the first queried object. Is there a simple way to return the title as a list of the queried objects? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • I am having the same issue – I can get the first search term in the archive title, but no more than that 🙁

    Were you to get it working at all?

    I’ve been searching the forums for awhile, and I don’t know have any good leads.

    If I understand your problem this might help you

    $terms = $wp_query->queried_objects;
    foreach(&terms as $term){
    echo $term->name;

    but maybe i’m wrong.

    thanks for responding, schwarzgrau, I’m really hoping to get this figured out soon.

    Do you mean $terms instead of &terms in the foreach? Even with that change, it says Invalid argument supplied for foreach().

    I did an echo $terms; but nothing comes up. I assume it should be an array.

    If you have any other suggestions, please help.

    I’m sorry I was wrong. I just expected you maybe need something like a while or foreach-loop to get more than one termname.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting Title With Commas’ is closed to new replies.