Never miss a thing!

Sign up to have the latest news and announcements from my site delivered straight to your inbox.
  • This field is for validation purposes and should be left unchanged.

Reader Interactions


  1. Hi Carrie, how would one call the new template in the functions.php file?

    For instance if I wanted to remove subnav from a post template I would use if (is_single ())

    Thx much,

  2. Hi Carrie,

    I am familiar with WordPress, HTML, & CSS and looking to learn the Genesis Framework. THank you for all your informative posts. They are making it easier to wrap my head around Genesis. Keep up the Great work. I’m looking forward to the next Office Hours broadcast.

  3. Hi Carrie,

    I’ve implemented your custom page template idea on I changed the maximum posts to display to 6, but pagination doesn’t show up. The other items are just missing. What can I do?

  4. OK, I feel like a complete idiot but the top the custom page template code that says:

    <?php //remove this entire line

    Well, you need that <?php there and I did what i said and deleted that line. (don't judge, but you can laugh LOL)

  5. Hi Carrie, Nice article, thanks. What if I want to create a custom home page in my very simple Genesis-sample theme? I don’t want to display posts, but just the content of my home page. Maybe add a slider? I would like to display this content dynamically, let say don’t put content in the code, but use WP the usual way.

    • Sounds like you’re after a widgetized home page then? (i.e. displaying dynamic content via widget areas versus a static page)? That’s a multi-part process. In short, you’d need to:

      1. Register any widget areas you wanted in the theme via functions.php
      2. Create a home page (front-page.php) to display your widget areas
      3. Add corresponding styles to your stylesheet.

      You can either pick apart an existing child theme that has front-page.php and deconstruct how it’s done or use something like Genesis Extender, which comes with “EZ” home page layouts to generate something for you without the hassle of code.

      If your goal is to learn it versus just getting it done, I’d pick apart child themes… πŸ™‚

  6. Hi Carrie

    Firstly, thank you so much for posting this – it is exactly what I needed!

    Secondly, I was having issues implementing the code (I have no knowledge of php). However I noticed the sections

    $video_id = esc_attr( genesis_get_custom_field( ‘cd_youtube_id’ ) );
    echo ”;

    Essentially created what we were after however the “posts” were pretty much just text with a “watch this” and “show me” link at the bottom – the show me link going to the post and the “watch this” link taking back to the category page.

    Any idea why this occurred? Seems like everybody else got this working without any issues.

    I also spent a fair few hours on this so I wouldn’t waste your time πŸ™‚

    Again thank you!

    • I left out an important step! I’m using a custom field on each of the posts called 'cd_youtube_id' and passing it the unique value of the YouTube file.

      For instance, if this is the full URL to a Youtube video:, anything appearing after the = sign is the ID. In this case it’s yp-GvaTL4L8.

      Completing that step would make it work as intended.

      However, if you’re wanting to show something else besides the title, the video thumbnail, and the Watch This/Show Me links (i.e. post content), then you would need to change what’s being spit out in the loop to whatever you want to display.

      If you’re wanting to display something different, let me know and I’ll try to point you in the right direction.

  7. Ah I wasn’t able to get it working! I’m sorry. I’ve literally tried everything. Is it possible for you to take a look? Please πŸ™‚

    Essentially I can’t seem to make the posts display as they would on any regular blog page / loop. I can see from your code here why they are displayed like that…but would rather they appear as they normally appear on a category page / main blog page.

    Does that make sense? I’ve been chopping and changing various bits of code to no avail.

    Thank you!!

    • If you want it to look like other category pages on your site, the easiest way is to use the built-in Category Archive settings. I went the custom loop route to display those “extras” instead of the usual output.

      • TouchΓ© but I also encounter the same issue as you – the category archive does not have the ability to have good quality editing of the article there.

  8. I used your code to create a custom category page for one specific category. How do I add pagination at the bottom, so users can look at additional posts if they want to?

  9. I changed to use the ‘genesis_entry_content’ action so that the generated content is inside the .entry-content div.

    I converted the above code to get my CPTs and I use the Advanced Custom Fields plugin to store the custom fields (as it allows for a nice data entry form).

  10. Love the tutorial however what I’d like to do is say in on my ‘Furniture’ page I’d like to add 4 of the most recent blog posts (with header & featured image) at the bottom all aligned in a row. The Php file is working fine but maybe its my css?

  11. Hi Carrie,

    I pretty new to WordPress in general, I haven’t used in since ’11 and was making my own themes.
    I need a custom static homepage, can I build a child theme and add a front-page.php file to get the homepage I want. Basically I need something like a combination of the executive theme and the news theme home pages.

  12. Hi! How would i edit the markup for the section, only on the interior pages? Basically, I want the header in the front-page.php to be different from the single.php pages. I created a template here that i can use for all my interior pages, but I figured there has to be another (simpler) way.

  13. I have tried to get this work and it pull any posts to display. I even gave some old posts the category of “genesis office hours” and it still isn’t pulling any posts to display. Is it because I have Prose, which is always confounding? Thank you for any assistance you can provide.

  14. Hi there, Carrie:

    Thanks so much for this tutorial (and for EVERYTHING you do – really appreciate your twisted sense of humor you use to spice up your blog).

    This might be a stupid question, but since I don’t see you mentioning plugins / tools to create your custom post types, custom taxonomies, nor custom fields, I thought I should ask.

    Can the genesis custom field function, similar to the one you listed at line 27 above:

    genesis_get_custom_field( ‘cd_youtube_id’ ) );

    Be used to call custom fields that were created with Advanced Custom Fields plugin?

    I know it might be strange to ask that here – and I am certainly not trying to ask you for support for a third-party plugin, but is a custom field always a custom field? I mean, do they live in the same place in the database no matter how they are created?

    And if you don’t use the ACF plugin, do you have a preferred way of creating custom fields?

    Thanks in advance for any help.


    BTW: Since I know I am not the only one who is really trying to understand the whole ball of wax of custom post types / custom taxonomies / custom fields / genesis CPT archives, and the Custom Page Template that you provided above, it sure would be great if there was a single road map to kind of put it all together for genesis 2.

    The difficulty for people like myself is we are often having to pick up bits and pieces of code from different places around the internets, and some of it is for Genesis 1, some for Genesis 2, some for wordpress WITHOUT genesis at all. And each person who writes about it has a completely different method of doing it.

    I know it is wishful thinking on my part. Maybe just an OVERVIEW of the start to finish process for creating custom post types, custom taxonomies, custom fields, genesis cpt archives, and your cpt page for people who are having difficulty putting it all together.

    • Hey Mark,
      Good question. πŸ™‚ Yep, you can call any custom field using genesis_get_custom_field('cf-name') (assuming you’re using the Genesis Framework, of course).

      Custom fields are stored in the wp_postmeta table as a key/value pair (key = the custom field name and value = whatever that value is assigned to that custom field). This database diagram may help make that more clear.

      Regarding your second comment, you’re right that it is a “whole ball of wax.” πŸ™‚ Maybe a tutorial forthcoming…


      • Thanks so much for the quick reply!!!

        “Yep, you can call any custom field using genesis_get_custom_field(‘cf-name’) (assuming you’re using the Genesis Framework, of course).”

        Ok, so all things being equal, it is probably better to call custom fields with the genesis built-in function than with a third-party plugin call function, since if there is a problem with that third-party plugin down the line, the genesis call will still be working, right?


        One more idea to pass along while you are mulling over future tutorials…

        Since you created the Winning Agent Pro theme (and I assume would like to see it become even more popular), maybe you could post some business and marketing tips on how us site developers might be able to get more real estate clients?

        Maybe even just a snappy response to say to a potential client when they loo at you with all seriousness and say, “Oh, I will just do my site it in wix for free…”

        Thanks again.

        • Ok, so all things being equal, it is probably better to call custom fields with the genesis built-in function than with a third-party plugin call function, since if there is a problem with that third-party plugin down the line, the genesis call will still be working, right?

          I’d say yes… take ACF for instance. You might eventually ditch that plugin for something like CMB, but the custom fields will still exist in the database, so you could continue to call them via the genesis function.

          Check out and subscribe to the blog – might be some good insights for working with the theme and real estate clients. πŸ™‚

  15. Happy Thanksgiving!
    Hi Carrie, I am using your winning agent pro theme and I love it. I am wanting to create separate page templates for each cities properties, i.e., tuscon-homes, dewey-homes, and the like. I need to widgetize it so I’m going to start with the home page as a template and then try and tweak it from there.

    My main question is: I am using the Genesis Simple Edits plugin to remove the footer links and I’ve added my own site-wide link back to the homepage. For each of the custom templates for each city, I want to be able to make that footer link point back to that (Silo) or that custom page. For example, each page that uses the tucson-homes template would have the footer link pointing back to

    I am doing this for SEO purposes and I would really appreciate your help. Thank you so much!


    • Hey Rick,
      You’re describing a fair amount of customization to build out all those templates. Unless each template layout is unique, I’d just make your customizations from functions.php to apply on those pages (using conditional statements). Also, if it’s just a separate sidebar you’re wanting on those pages, check out the Genesis Simple Sidebars plugin.


  16. This tutorial was great! I have question however, Can I make it so It displays some content in the the page, them my custom loop content, then some more content from the page editor?

  17. I’m using a modified Genesis grid loop instead of a standard loop, but this post led me to the solution I was looking for. I’m laughing out loud because I got it on my first attempt. That never happens…


  18. Really interesting tutorial Carrie. Thanks for your generosity.
    Unfortunately, it didn’t work for me. When I tried it – even with only genesis(); as the only line, when I go to that page, it just goes straight to my front page.
    I’m sure it is something simple (these things tend to be), but I’ve tried various things and for now, have run out of ideas.
    I’d appreciate some sort of clue as to what is going on and what I can do to fix it.
    Especially as others have got it working.
    I’m using the News Pro theme under Genesis by the way.

    • Hi Carrie again,
      It just occurred to me that it might be useful to say something about why I need to create a page template.
      I am wanting to dynamically construct a CSV file for download by users (involves quite a bit of SQL) and if I do it in PHP in the page itself, I can’t send the headers required because Genesis (and maybe WordPress) has already done it and I get an error message to say that the headers have already been set. So I thought a template would allow me to do the processing including setting the headers before the Genesis loop happens.
      It may be that there is a better way. If so, I’d be interested in hearing that also although I am still interested in knowing why my template just goes to the front page.

      Thanks – Will

      • By the time you get to a page template, the headers have already been sent. You’ll want to hook in your code (thinking genesis_init off the top of my head) in functions.php.

        So something along the lines of:

        add_action( 'genesis_init', 'do_stuff' );
        function do_stuff() {

        // Conditional statement to only continue if you're on the page(s) you want
        // Your code (inserted directly or just include reference to a file, which may be cleaner in your case.


        You can also use the Query Monitor plugin to see the order of hooks fired on a page – if genesis_init isn’t the ticket, you can see from the load stack which would be the better place to hook into.

        • Wow – Query Monitor is a powerful plugin. Thanks for that.
          The hooks for Genesis are:

          My function is being fired in the genesis_init() hook, but none of the code.

          In my functions.php (actually a plugin I created to isolate all the hooks I’m using), I have the code:

          add_action( ‘genesis_init’, ‘download_csv’ );
          function download_csv()
          $will_log=fopen( ABSPATH . ‘wp-content/admin/will-log’,’w’ );
          fwrite( $will_log, “About to check on the page id (3812).\n” );
          fclose( $will_log );
          if (is_page(3812))
          include(ABSPATH . ‘wp-content/admin/member_get_register_csv.php’);

          The “will-log” file doesn’t get created.

          I did a bit of research and discovered:

          which seems to indicate that genesis_init() is deprecated which is hard to believe as there doesn’t appear to be any replacement.

          Any thoughts?

          • Update:
            Got the logging to work by creating an empty file “will-log”.
            The code is now:
            //* Hook before genesis_init() to download CSV files.
            add_action( ‘genesis_init’, ‘download_csv’ );
            function download_csv()
            global $post;
            $will_log=fopen(ABSPATH . ‘wp-content/admin/will-log’,’w’);
            fwrite($will_log,”About to check on the page id (3812) in” . $post->ID . “.\n”);
            if (is_page(3812))
            include(ABSPATH . ‘wp-content/admin/member_get_register_csv.php’);

            But the content of the file is:
            About to check on the page id (3812) in.

            which implies that the page ID isn’t available at the point of genesis_init() – which sort of explains why my test on it isn’t working.

            Ho hum.

          • As $post->ID does not seem to be working, try appending a var_export()call to your log:
            var_export($post, true);
            Then you will see if that variable is available.

  19. So in response to:
    fwrite($will_log,”About to check on the page id (3812) in page: ” . $post->ID . “.\n” . “Vars are:” . var_export($post, true) . “.\n”);

    I get:
    About to check on the page id (3812) in page: .
    Vars are:NULL.

    So it seems that $post is NOT available. Didn’t know about var_export() though – so that’s another notch to add to my PHP learning.

    I’m still wondering where I can hook in to be able to place the code:

    header(‘Content-Type: text/csv; charset=utf-8’);
    header(‘Content-Disposition: attachment; filename=UKATA_register’ . $now . ‘.csv’);
    $output=fopen(‘php://output’, ‘w’);
    for ($i=0;$i<count($register_ary);$i++)

    before the headers get set by Genesis.

    It would appear that genesis_init() is not the place!

    By the way – thank you again for your help with this – especially as I have now gone a bit off-topic away from page templates.

    • Since we’re getting off-topic from the original post, I’d recommend starting a gist or pastie for the code and move the discussion over there (feel free to add a link ref in this comment thread for anyone who wants to follow). It’ll make the code cleaner and conversation easier to follow. πŸ™‚

      Regarding genesis_init() – that function was only a wrapper for genesis_init action hook. The function was deprecateed, but the action hook is still in place. Just confusing as there’s quite a few instances in Genesis where a function and an action hook are named the same.

      • Hi Carrie,
        I trust you had a great Christmas. After the invasion, it’s good to get back to do battle with WordPress.
        I have started a Git at:
        I have only pasted the code as I am new to GitHub and haven’t worked out all of the features yet.

        I noticed that Damien Carbery suggests stepping outside of WP. I am reluctant to do that as I would not have access to the WP methods of accessing the database which would be a pity and would also involve setting up a mysql user for the purpose.

        There are various posts on the web regarding setting up a CSV download, but I think that Genesis is getting in the way. I’m sure there must be a way.

    • @stgsunshine12: Can you email me (via the Contact form on my web site) to continue this conversation. I think that you should just link to the member_get_register_csv.php page and don’t involve WP at all.

  20. Carrie,

    I have a website that I’m building on the Altitude theme currently (formerly Agency), let’s call it What I’m trying to figure out is if it’s even possible to is to have a different “home” pages (i.e., having the sleek, widgeted look of the main home page) for different regions (e.g.,, Is that possible withing a Genesis framework, or am i asking too much from it? Do you know anything about working with Dynamik?


    • It sounds like you’re after landing pages for each of those regions. That’s certainly possible with Genesis, although you’re looking at some sort of customization. Have you taken a look at Rainmaker? They’ve got a lot of slick landing page templates.

  21. Hi – I have a custom taxonomy for photos that gets there via Enhanced Media Library and I’d like to create a custom archive output (list all entries (photos) in a media_category in a special format I can style with css).

    This looks like the right approach to take – but I’m not sure how I would call the taxonomy (in place of a “normal” category)? Little help?

  22. Hi, Carrie. Thank you for your careful tutorial.

    Can I ask you how would I code this template so that I could have these fields displayed alongside the genesis_entry_content (and not at the very end of the page)?

    Thank you!

  23. Carrie,

    Echoing all the other followers praise for your tuts! Invaluable to those learning genesis late nights! I am setting up on Parallax Pro and trying to see how to use the widgetised parallax frontpage for other pages (aka a landing page). I created a full_landing.php and copied in the frontpage php code but of course while I could see the template in the template drop downs, it didn’t render a replica parallax homepage. Not sure what I need to do now! I thought copying it would be sufficient. Or do I need to edit the copied front-page.php code somehow?
    Thanks in advance for your help! I love parallax features – ideal for a sales / landing page – and hate the narrow landing pages Genesis provides!

  24. Thanks so much for all the great information! I’m wondering how I would add a div around the custom loop? I’d like to style it narrower than the page content. Thanks!

    • Hey Susan,
      You wouldn’t necessarily need a new div. You could use the body class to help target the content area for your custom page. The most obvious body class is the page ID, but you can add custom body classes in Genesis to any page or post from the editor screen (Layout section). Then you’d just do something like:

      .custom-body-class .content-area {}

  25. Hi Carrie!
    Thanks for the tutorial. You had said “Article update: Since I originally wrote this article, I’m no longer using the examples I give on this site. The code still works just fine though. :)” So, I wondered what you are using now to create custom front page templates for Genesis? Thank you! -Karin

  26. Hi Carrie,

    Thanks for this tutorial. I am using it as a basis to create my page template, but I’m trying to figure out how to add a link to the title of the post, so I can just click on the title to go to the post. Any help with this would be much appreciated.

  27. Hi Carrie,
    It seems like this question has been asked few times however the answer was a link to codex. I would appreciate a fix to the pagination issue in the code itself in this article.

    I have created a page here the only issue I am facing is pagination. If you go to this link you will notice that the previous page does show however it shows on top of the videos.

    It would be helpful if you can help.


    • Heya! Always make your edits in a child theme vs Genesis itself (that way you can always update Genesis without messing up your site).

      You could definitely use functions.php or, depending on how extensive your changes, create a separate (non-template) file with all your header mods and bring it in via functions.php with require_once().

  28. Hello, I have a question please. Is it possible to still show the static content entered by the editor on top of the page, then right after, do our logic to retrieve data from database etc? I am referring to Genesis. Thanks

  29. Carrie -you’ve indicated you no longer use this tutorial to create a custom page template. What are you using now? Curious minds want to know!

  30. Hey Carie.. Thanks for the great article.Acaully i am new to genesis framework and i created the blog template with custom Wp_query loop with Pagination and it works fine but i also want another custom loop for sidebar to display latest events and it works fine on the 1st page but my latest posts are missing on 2nd and so on pages…please help me

  31. This is great, is there a way to add a class for styling which would go around the posts section of the loop part (ie: around the ‘area’ where the posts are pulled in) I understand how your brought classes in around each post, i’m asking about one class or ‘wrapper’ around all the posts area that the loop pulls in, yet does not encompass the top of the main page content area?

    Thank you for all your great stuff πŸ™‚

  32. Would it work for you to add the class to the div with ‘one-third first’ classes? Or do you want it higher up?
    Another option could be to add a class to the body of the page by using the ‘body_class’ filter.


Leave a Reply

Your email address will not be published. Required fields are marked *