How to register new page in route

Want a successful Modern site?

Start with IQRA training; it’s easy and quick to your needs.

    How to register new page in route.   

 

Global Add Action

  1. add_router_page
     
     
    1. add_route_page($data)
     
    parametors
     
    1. data (array)

     

    data

    1. slug (required)
    2. filepath (required)

    Note:

    1. Always create first page from admin with same slug
    2. filepath Location : IQRAtheme/view/

     

    function router(){
        add_route_page(array('permalink'=>'download','filepath'=>'pages/download'));   
    }
    
    add_action('add_router_page' , 'router');