Forums

[Plugin: Custom Field Taxonomies] get_linked_meta: how to change url structure (5 posts)

  1. carpenoctem
    Member
    Posted 2 years ago #

    This is my category page: http://example.com/music
    This works great: http://example.com/music?artist=somebody

    This is what i have in my template:
    <?php echo get_linked_meta(get_the_ID(), 'artist') ?>
    It outputs: http://example.com/?artist=somebody

    How do i get it to output http://example.com/music?artist=somebody ?

    I couldn't find any info in the readme.

  2. scribu
    Member
    Posted 2 years ago #

    Here's the header of that function:

    function get_linked_meta($id, $key, $glue = ', ', $relative = false)

    Try calling it with $relative = true:

    <?php echo get_linked_meta(get_the_ID(), 'artist', ', ', true) ?>

  3. carpenoctem
    Member
    Posted 2 years ago #

    Thank you very much! Works great!

  4. carpenoctem
    Member
    Posted 2 years ago #

    Well, it works the way it should work (relatively to the url), but I don't think that's good for me :(

    When my url is http://example.com/music/page/3 it outputs http://example.com/music/page/3?artist=somebody
    Is there a way to make it stick to the category, ignore the paging and output http://example.com/music?artist=somebody on every page?

  5. carpenoctem
    Member
    Posted 2 years ago #

    Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic