WordPress : How to add custom template in genesis framework

I am creating a custom members area for my client’s employees. Basically, what I’ve done so far is I created a new role=consultants and I gave that role a read only access.
Then I uploaded the Peter’s Login Redirect Plugin so that the consultants (employees) land in a page called CONSULTANTS PORTAL. From there, they will be able to access their individual page which it will load as long as the name of the page matches the username given to them. That way they can only see their own page.

To see this process, you can visit this link in the wordpress.org forums EASY CLIENT PORTAL

Read More

So I’ve managed a lot of it, except…I am supposed to duplicate the page.php and then add the script that will make the individual page show up. But, the Genesis Framework is pretty complicated. The page.php has an empty skeleton and the actual meat of the page is in a li/structure root folder (That’s what I think anyway) .

As it is right now, I have the following in my default template page consultants-portal.php

<?php
/**
* Template Name: Consultants Portal
*/

global $current_user;
get_currentuserinfo();
$page = get_page_by_title($current_user->user_login);
_e($page->post_content);
genesis();
?>

This code gets me this. You can see the content (my page) loading before the page loads. Which tells me there is something else I need to add to this so that the content loads in the actual white area of the page.

The instructions in the link I mentioned says to add the dynamic script right above the is_page or have_posts, but I as I said, Genesis doesn’t have this in page.php. instead it is all broken in pieces and spread through the root.

Sorry if I made this too long to read, I wanted you to have all the info I have.

has anyone done this before?

enter image description here

Related posts

Leave a Reply

1 comment

  1. Try out the following code:

    <?php
    /**
    * Template Name: Consultants Portal
    */
    
    // remove Genesis default loop
    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );
    
    // add a custom loop
    add_action( ‘genesis_loop’, ‘my_custom_loop’ );
    
    function my_custom_loop () {
    
    // add your queries or custom structure here
        global $current_user;
        get_currentuserinfo();
        $page = get_page_by_title($current_user->user_login);
        _e($page->post_content);
    
    }
    
    genesis(); ?>
    

    Instead of writing the code directly, write it inside the loop function as above.