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


  #26  
Old Dec 12, 2013, 10:33 AM
Jet9009
 
23 posts · Dec 2010
I don't understand how the template is working in the documentation... Should i create a custom sub-template in montezuma ?

I want to display the first post of 5 different categories. But those categories will be child of the category Projets.

So it will be the 5 first post of the category projets too .

I'm really sorry if i'm confusing it's hard for me to explain in english ahah. I'm feeling like you are wasting your time with me. x) Sorry sorry :/

And thank you for everything..

edit : http://micheldidier.com/decliic-test/projets

The result i got here is what i want, just the 5 differents colors missing :/

Last edited by Jet9009; Dec 12, 2013 at 10:37 AM.
  #27  
Old Dec 12, 2013, 12:20 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
1) create a folder in the Montezuma folder called 'list-category-posts'

2) copy the contents of 'wp-content/plugins/list-category-posts/templates' into that new folder. Now the folder will contain 2 test 'default.php' and 'readme.txt'.

3) rename 'default.php' to 'my-lcp-template.php'

4)edit default.php and change lines 54-56 from
HTML Code:
foreach ($this->catlist->get_categories_posts() as $single):
    //Start a List Item for each post:
    $lcp_display_output .= "<li>";
to
HTML Code:
foreach ($this->catlist->get_categories_posts() as $single):
    //Start a List Item for each post:
    $categories = "";
	foreach((get_the_category($single->ID)) as $category) { 
		$categories .= ' cat-'.$category->category_nicename ; 
			} 
    $lcp_display_output .= '<li class="post-'.$single->ID. $categories.'">';
5) edit your 'projects' page and inset the short code
HTML Code:
[catlist name="project" content=yes template=my-lcp-template orderby=date order=asc numberposts=5]
this should give you the first 5 posts that have a category of 'project' each post will have an LI with a class of its postID and 'cat-xxxx' where xxxx is it's category slug name

This
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #28  
Old Dec 12, 2013, 01:51 PM
Jet9009
 
23 posts · Dec 2010
thanks a lot for your help, i didn't know I had to put the files into montezuma folder.

With the template, my "more link" on each post is not showing anymore,

I've added this line
Code:
$lcp_display_output .= $this->catlist->get_morelink($single, 'a', 'lcp_morelink');
on my template file before the "endforeach". But nothing showing up.

My shortcode is :

Code:
[catlist name=projets template=default numberposts=5 orderby=date order=desc excerpt=yes excerpt_size=30 posts_morelink="Lire la suite." excerpt_tag=p excerpt_class=lcp_excerpt title_tag=h2 posts_morelink_class=morelink class=row]

Anyways, thx a lot for your help guys. As a student, i'm running low on money, i will make a donation to each of you as soon as possible.
  #29  
Old Dec 12, 2013, 05:37 PM
Jet9009
 
23 posts · Dec 2010
I've found a solution, adding this line before the end of the loop in the template :
Code:
//Post morelink
$lcp_display_output .= '<a href="' . get_permalink($single->ID) . '">Lire la suite.</a>';

thx again for your help guys!!!

You can mark this thread as solved !!!

Bookmarks



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 07:25 AM
"RIGHT sidebar: Don't display on Pages" on children of specific parent Sprutt Sidebars & Widgets 1 Mar 23, 2010 04:12 PM
How to Display Comments on Category Pages Only fylraen Comments, trackbacks & pings 4 Nov 5, 2009 03:04 PM
Full Post Text on specific category pages spencer Atahualpa 3 Wordpress theme 1 Jul 7, 2009 03:47 PM


All times are GMT -6. The time now is 08:37 PM.


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