Viewed   79 times

I'm creating a customized WordPress theme based on an existing site.

I want to use an alternate dashboard which I have created.

How can I have the user directed to 'news.php' after login instead of '/wp-admin/' ?


EDIT: Have a working Plug-in for this but the bounty is still availible for anyone who can find a manual way to do this through functions.php, as it would be more secure then using a 3rd party plug-in.



This should solve your problem. Adapted from an answer found here.

Add the following snippet of code in the functions.php file of your theme:

function admin_default_page() {
  return '/new-dashboard-url';

add_filter('login_redirect', 'admin_default_page');
Saturday, August 13, 2022

I would guess you need to decode the search term you are extracting from the query string, like so: $search_query[$query_split[0]] = urldecode($query_split[1]). Although, you could probably just use Wordpress's get_query_var function instead of all that code.

Tuesday, October 11, 2022

It worked fine after updating the search.php as following,



//Page Title Bar
$pageTitle = 'Search results for: "'.get_search_query().'"';
echo page_title_bar( $pageTitle, get_template_directory_uri().'/framework/assets/images/pg-title-bar.jpg');

<div class="container blog-wrapper page-container">
    <div class="row">
        <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                    // Include Blog Posts List
                    get_template_part('framework/template-parts/post/blog', 'post-list');

            <?php endwhile; ?>

            <div class="pagination-wrapper">
                <?php pagination(); ?>

            <?php else: ?>
                <h3>No results found for: '<?php echo get_search_query(); ?>'</h3>
            <?php endif; ?>

        <div class="col-lg-3 col-md-3 col-sm-12 col-xs-12">
                // Include Blog Sidebar
                get_template_part('framework/template-parts/post/blog', 'sidebar');

<?php get_footer(); ?>

If I get a reasonable and well described answer I can offer the bounty for that answer.

Thursday, October 13, 2022

This is probably happening because something like this is being called: user_session_path(user) and you actually don't need the user as argument, so Rails treats it as the format. This is likely wrong in the form_for call in your sign in view. after_sign_in_path_for is not being called because Rails is not considering the given URL a valid request (that's why the response is 406 acceptable).

Saturday, August 6, 2022

You will need to modify users controller. But to keep it "update proof" you cannot modify the core code, thats why we will make an override:

  1. Go to the components/com_users/controllers/ and duplicate a file called user.php, you can call a new file user2.php
  2. Open user2.php file and rename controller class to UsersControllerUser2
  3. Create a template override of your login module (to make it update proof also), create a templates/YOUR_TEMPLATE/html/mod_login folder and copy modules/mod_login/tmpl/default.php file there.
  4. Open file created in step 3 and change login module task from <input type="hidden" name="task" value="user.login" /> to <input type="hidden" name="task" value="user2.login" />
  5. Open user2.php file once again, and modify this part of code (around lines 77-82):

$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));

Change $app->redirect route to whatever you want :)

Friday, September 30, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :