Custom templates and login redirect issue

Hello, I am trying to set up a custom template for when you click on a Category listing link, at the moment it is just using my default templete from wordpress.

I have managed to create a default template for an individual listing by creating the file: single-listing.php in the main theme directory, but i cannot seem to find an alternative for a category or tag listing.

Also since i have installed the plug in, when i log in to my admin i am now been taken to the home page. obviously this is because the Redirect URL (sign in) is empty. My issue is that i want to directed to my admin dashboard when loged in as admin. But if a directory person login i want them to be taken to the page which i have selected on the Redirect URL (sign in).

is this possible? if not how can i disable this feature as there are plugins that do this task, but are been overridden by the directory plugin.

many thanks in advice

  • aristath

    Hello there @peter_caines and welcome to the WPMU-DEV Community!

    I have managed to create a default template for an individual listing by creating the file: single-listing.php in the main theme directory, but i cannot seem to find an alternative for a category or tag listing.

    Try the archive-listings.php file. :wink:

    Also since i have installed the plug in, when i log in to my admin i am now been taken to the home page. obviously this is because the Redirect URL (sign in) is empty. My issue is that i want to directed to my admin dashboard when loged in as admin. But if a directory person login i want them to be taken to the page which i have selected on the Redirect URL (sign in).

    I haven't tried this, but you can try adding the following in your functions.php:

    function admin_default_page() {
      if ( is_admin() )
        return '/wp-admin';
    }
    
    add_filter('login_redirect', 'admin_default_page');

    I hope that helps!

    Cheers,
    Ari.

  • aristath

    Hi thanks for the quick reply, the archive-listings.php is the template for the main all listings, i am trying to file a template file for when you click on the tag links or category links within the directory.

    Then you should create these 2 files in your template:
    taxonomy-listing_tag.php
    taxonomy-listing_category.php

    Thanks for the redirect code, it put me on the right track

    I'm glad I could help!

    I am marking this issue as resolved.
    If however the above solution doesn't work for you or you need any further assistance don't hesitate to reopen this and post an update on your current status!

    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.