Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

[SOLVED] Display pages from one specific category


  #1  
Old Nov 26, 2013, 10:58 AM
Jet9009
 
23 posts · Dec 2010
[SOLVED] Display pages from one specific category

Hi guys,

I'm using for the first time Montezuma and it's also the first time i'm trying to make kind of a professional website with Wordpress (for the cms, php and all the dynamics stuff).

I'm still in school and studying multimedia, webdesign, devlopment in France, sorry if i'm using a bad or aproximate english.

I got 3 really different pages so i guess i should use 3 different main templates in Montezuma or create them.

The first one which i'm pretty done with is looking like this in my illustrator mockup :

https://www.dropbox.com/s/4n4oh94obl...2013.47.58.png

The second one i'm working on it and stuck on it is looking like this :

https://www.dropbox.com/s/y7szcgob0n...2013.48.06.png

As you may see,
the first page is looping through the 3 last post, and for the slider i've created a dynamic_sidebar and used a widget in order to show featured posts.

The color are changed using css and created categories/class from each post. Yellow for what's about school for example... Then purple for what's about the back country... etc

On my second page, who's the "project" page, i want to display the 5 last project on which the organisation is working.

But... I don't know if i've to loop through the post or pages.
I'm explaining : for the 3 posts on the main page, i'm simply using the bfa_loop thing and looping through posts... But on the "Project" page, i've to loop through pages or post (what's the best way ? looping through pages or posts ?) and display the different projects.

My idea was to add a category to each post i'd like to show on this specific page like category called "projects" and then loop through all my post and only displaying the ones who are belonging to "projects"... But i can't find how to do it :/

I have to admit i'm a bit lost, i've asked to one of my teacher he doesn't know how to help me because he is not using wordpress lol.

I hope one of you will understand what i'm trying to do and will be able to help!!

Thx,

Jet.

Last edited by Jet9009; Dec 5, 2013 at 11:49 AM.
  #2  
Old Nov 26, 2013, 01:47 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I have used the List Category Posts plugin with various attributes for something like this. It's hard to explain so you will have to read through the documentation to understand how to configure it.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Nov 26, 2013, 03:39 PM
Jet9009
 
23 posts · Dec 2010
Ok, i'm going to have a look at this plugin... thanks !

If you guys got any idea about doing the same thing without using a plugin but doing it directly in a virtual template or subtemplate it could be useful. Thanks anyway !
  #4  
Old Dec 2, 2013, 01:45 PM
Jet9009
 
23 posts · Dec 2010
Quote:
Originally Posted by lmilesw
I have used the List Category Posts plugin with various attributes for something like this. It's hard to explain so you will have to read through the documentation to understand how to configure it.
Hi,

I'm back after a few tries,
I've tried to work with the plugin you told me to.
It's working if i want to display posts from a category, and display the title of the post, the excerpt... (but not a read more link, don't know why)
But i can't add a class generated like Montezuma template is doing it easily...
I mean : When my page is loaded into the browser, if I inspect the element, their should be two classes on each <i> item... Why ? Because, i have to show every "project" post... But the color of each post has to be different by using another categorie.

For example :
<li class="projects rehab"/>
and <li class="projects garden"/>

We can do it easily in the montezuma's template by saying <li class="post-category"/>

I'd like to do kind of the same thing...

In the plugin doc, we have :

Quote:
Template System

Templates for the List Category Plugin are searched for in your WordPress theme's folder. You should create a folder named list-category-posts under 'wp-content/themes/your-theme-folder'. Template files are .php files.

You can use the included template as an example to start. It's in the plugin's template folder under the name default.php. To use a template, use this code:

[catlist id=1 template=templatename]

If the template file were templatename.php.

You can have as many different templates as you want, and use them in different pages and posts. The template code is pretty well documented, so if you're a bit familiar with HTML and PHP, you'll have no problems creating your own template. I'm planning on reworking the template system in order to have a really user friendly way to create templates.
http://wordpress.org/plugins/list-ca...s/other_notes/

But I guess we can't link a montezuma virtual template to the plugin... or i'm doing it the wrong way... right ?
  #5  
Old Dec 2, 2013, 02:49 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you want the <li class="projects rehab"/> and <li class="projects garden"/> to have different colors, the CSS selectors you would use would be
HTML Code:
li.projects.rehab {…….}
li.projects.garden {…….}
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Dec 2, 2013, 11:38 PM
CrouchingBruin's Avatar
CrouchingBruin
 
299 posts · Aug 2010
Santa Monica, CA
If you create your sub-categories as children of the Projects category, then it should be relatively easy to color-code each sub-category.

For example, if you create the Garden category with Projects as its parent, and another category called Rehab, also with Projects as its parent, then this address will display all posts with the category of Projects, including all those belonging to Garden and Rehab:
yoursite.com/category/projects

Each individual post will have the class category-projects assigned to it, as well as either category-garden or category-rehab.
__________________
My Montezuma-themed sites: ESHS Girls Basketball Team, Venice Hongwanji Buddhist Temple
Please consider making a donation to BytesForAll for their great themes!
  #7  
Old Dec 9, 2013, 08:16 PM
Jet9009
 
23 posts · Dec 2010
sorry for the late reply guys,

I had to fix some glitches on my web host!

I don't get it, i'm using the plugin you told me to use. (List Category Post plugin).

You can see the result here : http://micheldidier.com/decliic-test/projets

I got everything I need as we can see... But... There is no css class on the <li> element.
and i can't find how to dynamicly create some with the help of PHP and make it work kind of the same way as the bfa loop is working (generating element dynamicly like <li class="category-projets category-rehab"></li> for example)

I can create one, but it will not change and it will be the same for every <li> elements.

http://wordpress.org/plugins/list-ca...s/other_notes/

I may be blind or missing something... if you got any advice...

thanks a lot !

edit : the best way could probably be to create a template... but i don't get it because it's probably not working with the montezuma PHP shortcodes... :/

Last edited by Jet9009; Dec 9, 2013 at 08:19 PM.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to: display category name on category pages wittyusername Center area post/pages 3 Feb 25, 2011 06:25 AM
"RIGHT sidebar: Don't display on Pages" on children of specific parent Sprutt Sidebars & Widgets 1 Mar 23, 2010 03:12 PM
How to Display Comments on Category Pages Only fylraen Comments, trackbacks & pings 4 Nov 5, 2009 02:04 PM
Full Post Text on specific category pages spencer Atahualpa 3 Wordpress theme 1 Jul 7, 2009 02:47 PM


All times are GMT -6. The time now is 02:04 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.