WordPress.org

Ready to get started?Download WordPress

Forums

Query Multiple Taxonomies
Getting Title With Commas (5 posts)

  1. magus824
    Member
    Posted 1 year ago #

    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!

    http://wordpress.org/extend/plugins/query-multiple-taxonomies/

  2. asterbird
    Member
    Posted 1 year ago #

    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.

  3. schwarzgrau
    Member
    Posted 1 year ago #

    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.

  4. asterbird
    Member
    Posted 1 year ago #

    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.

  5. schwarzgrau
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic