• Hi ppl!

    I have an opinion website and about 20 writers writing for it. I always posting their posts under my own username. Now I want to make for each of these writers their own personal page with all the articles they wrote on the website. Normally, that would be no problem if you just select by username. But that is not the case by me. So I have this idea, and please if you have a better suggestion let me know!


    An example:

    Creating tag James William for the writer James William so I will be able to somehow select tag James William and so see all the articles with the name James William!

    Does anybody have a better suggestion?

Viewing 1 replies (of 1 total)
  • You could register a custom taxonomy and use that to sort out the writers (would go in your theme’s functions.php file).

    register_taxonomy( 'writers' , 'post' , array(
    	'label' => 'Writers',
    	'public' => true,
    	'hierarchical' => false,
    	'show_ui' => 1,
    	'rewrite' => true,
    	'query_var' => 'writers'
    ) );

    You then add a writer to a post in the same way you would a tag, you’ll see a box that looks just like the tags one, but called Writers, add the writers as you would a tag.

    You can then query your site like so to see posts with that writer (for example the writer is Joe Bloggs, with the slug joe-bloggs).

    example.com/?taxonomy=writers&term=joe-bloggs

    or for pretty permalinks (if you were using the numeric permalinks setting for example)

    example.com/archives/writers/joe-bloggs/

    Pretty URL usage will vary depending on your chosen permalink structure, the first should work in any case..

    NOTE: The above is tested code, under 2.9.2 using the default theme.

Viewing 1 replies (of 1 total)

The topic ‘Selecting authors by tags!’ is closed to new replies.