WordPress.org

Support

Support » Plugins and Hacks » need help with custom archive pages/rewrites

need help with custom archive pages/rewrites

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rachel Carden
    Participant

    @bamadesigner

    Well, the first thing I notice is that your rewrite rule is missing ‘attorney’. Try this:

    add_rewrite_rule( '^noteworthy-cases/attorney/([^/]*)/?', 'index.php?post_type=noteworthy-cases&attorney=$matches[1]&cpt_onomy_archive=1', 'top' );

    Be sure to flush your rewrite rules each time you edit them. Flush your rewrite rules by visiting Settings -> Permalinks and clicking “Save Changes”.

    Let me know if that takes care of the problem.

    abacus718
    Member

    @abacus718

    Thanks for the quick response rachel. I added attorneys to the rule (copied what you had) but now it just takes me to the attorney’s page — not to the noteworthy cases page filtered by attorney:

    http://tin.abacusdesign.net/noteworthy-cases/attorney/jacob-sussman/

    Plugin Author Rachel Carden
    Participant

    @bamadesigner

    Hmm. The answer probably lies in tweaking some of your custom post type settings. Think you could share screenshots of the noteworthy cases and attorney settings?

    abacus718
    Member

    @abacus718

    Hi.. So here are screenshots of the cptonomy setting for notable case: http://tin.abacusdesign.net/tin_cptaxonomy.png

    Jacob sussman has three cases assigned to him (if i edit attorneys and look at the noteworthy case taxonomy).

    I changed the rewrite rule to this (in case the use of attorney was fouling things up):
    add_rewrite_rule( ‘^noteworthy-cases/counsel/([^/]*)/?’, ‘index.php?post_type=noteworthycase&attorney=$matches[1]&cpt_onomy_archive=1’, ‘top’ );

    Also, i fixed the fact that the custom post type used to be called notable case and made everything consistent with noteworthycase, but still no dice. Going here and clicking on ‘cases by attorney’ and selecting ‘jacob sussman’ takes you to his profile page, not the three cases assigned to him. Any ideas? Thanks!

    P.S. Interestingly, using the archive (cases by year) link and then adding on attorney= doesn’t seem to work either: http://tin.abacusdesign.net/2012/?post_type=noteworthycase&attorney=jacob-sussman
    it has the same result — of taking you to the attorney detail page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘need help with custom archive pages/rewrites’ is closed to new replies.