StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 09-26-2012, 04:50 PM
badpenguin badpenguin is offline
Registered User
Genesis Member
 
Join Date: Dec 2011
Location: Italy
Posts: 51
Default how to create a page templat that act as directory?

I want to create a page that act as a category and show all the posts:
a kind of sitemap.

I called a page with the slug "/map" and assigned it my custom page template.

In the template i just override wp_query:
PHP Code:
global $wp_query;
$wp_query = new WP_Query('category_name=camping,village');
genesis(); 
This way it looks with the right CSS from my category template
but it uses wrong HTML-Titlte and its missing H1 tags and also the body of the original /map page.

Is there a way in genesis of simply doing this? I.e.
1. creating a page and using H1, TITLE, and Body from the Page
2. display posts from a custom WP_Query the same way as if i accessed /category/

EDIT:

I've found a very hacky solution:
PHP Code:
global $wp_query;
$x = new WP_Query('category_name=camping,village');
// Merge query results with the WP_Query from the /map slug page
foreach ($x->posts as $p) {
    
$wp_query->posts[] = $p;

However a better less hacky way is preferred

Thanks, Antonio
  #2  
Old 09-26-2012, 07:15 PM
jjaycallejas jjaycallejas is offline
Registered User
Pro Plus Member
 
Join Date: Nov 2011
Posts: 154
Default

How about something like this? http://www.briangardner.com/custom-archives-page/
  #3  
Old 09-27-2012, 02:09 AM
badpenguin badpenguin is offline
Registered User
Genesis Member
 
Join Date: Dec 2011
Location: Italy
Posts: 51
Default

Quote:
Originally Posted by jjaycallejas View Post
This will not work in my case because i need to hack the wp_query
before the loop, i handle the archive loop in functions.php i don't need to recreate
it in this template.

Also a plugin apply_filter() call it in the "before wrap" functions.

So its not something i can do with the custom grid loop.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create blog in directory of site to build it then when finished move to root? surflook General Discussion 4 03-10-2010 07:36 PM
Unable to create directory mikeoh General Discussion 3 02-02-2009 09:46 AM


All times are GMT -5. The time now is 03:25 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.