Custom member hompage using wordpress

Discussion in 'Templates customization' started by sharpend, Apr 24, 2020.

  1. sharpend

    sharpend aMember Pro Customer

    Joined:
    Jan 8, 2008
    Messages:
    28
    Hi - I get that we can swap out the default member homepage using a specific page.

    Is it possible to use a wordpress page as a start page?

    Thank you.
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Hello,

    You can use the following code snippet in site.php:
    https://docs.amember.com/docs/Site_php_file

    PHP:
    class DashboardController extends Am_Mvc_Controller
    {
        function 
    indexAction()
        {
            
    Am_Mvc_Response::redirectLocation('/any/your/url');
        }
    }

    Am_Di::getInstance()->router->addRoute('dashboard', new Am_Mvc_Router_Route('member', [
        
    'module' => 'default',
        
    'controller' => 'dashboard',
        
    'action' => 'index',
    ]));
    replace /any/your/url in code above with url of your desired page.

    Best Regards.
    sharpend likes this.

Share This Page