I run an MMA website dedicated to Alaska combat sports news, etc.
I have a page showing the title holding fighters for each fight promotion. Each title holding fighter has their own single-fighter.php page where it shows a pic + some data. Below that I want to list any posts the fighter has been tagged in.
I’ve gotten success with this method, using a custom post type that the writers can use to determine what tag should be used:
$fighterTag = get_post_meta( get_the_ID(), ‘fighterTag’, true );
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
…. the posts
^So this works as long as the tag being entered as a value for the fighterTag custom post type does not have spaces. Is there any magical way to get this puppy to work with tags that have spaces?
Any help would be immensely appreciated!
- The topic ‘List posts by tag with spaces’ is closed to new replies.