Format output with template – or class
-
This plugin is fantastic and so helpful to me in the site I am building.
The only thing lacking (IMO) is the ability to add a class parameter to the href links created in the output. I suspect others might have different formatting needs, so the ability to templatify the output would be helpful.
I hacked a solution by passing in a parameter called a_class. If a_class is set, add it to the href being built.
Snippet here: (my changes marked with //KPR )
$link = get_permalink( $page->ID ); $list_pages_html .= '<div class="page-list-ext-item">'; $a_class_html = (empty($a_class)?'' : ' class="'.$a_class.'"'); // KPR if( $show_image == 1 ){ if ( function_exists( 'get_the_post_thumbnail' ) ) { // if we have WordPress 2.9+ if( get_the_post_thumbnail( $page->ID ) ){ // if there is a featured image $list_pages_html .= '<div class="page-list-ext-image"><a href="'.$link.'" title="'.esc_attr($page->post_title).'"' . $a_class_html .'>'; // KPR
I hacked a solution to achieve my result but would love to see something similar incorporated into your plugin code.
BTW, I’m using your plugin to build a list of child pages in a thumbnail/gallery format and I’m applying a class to the href’s so that I can display the linked pages in a lightbox style pop-up.
http://www.no-rep.tv/about/coaches/
thanks again for this simple and helpful plugin!
- The topic ‘Format output with template – or class’ is closed to new replies.