Support » Plugin: Page-list » [Plugin: Page-list] Displaying thumbnails instead of a list

Viewing 1 replies (of 1 total)
  • Plugin Author webvitalii

    (@webvitaly)

    You should create your list of pages manually and without wp_list_pages():

    <?php
    $page_list_ext_args = array(
    	'show_image' => $show_image,
    	'show_title' => $show_title,
    	'show_content' => $show_content,
    	'limit_content' => $limit_content,
    	'image_width' => $image_width,
    	'image_height' => $image_height,
    	'child_of' => pagelist_norm_params($child_of),
    	'sort_order' => $sort_order,
    	'sort_column' => $sort_column,
    	'hierarchical' => $hierarchical,
    	'exclude' => pagelist_norm_params($exclude),
    	'include' => $include,
    	'meta_key'     => $meta_key,
    	'meta_value'   => $meta_value,
    	'authors' => $authors,
    	'parent' => pagelist_norm_params($parent),
    	'exclude_tree' => $exclude_tree,
    	'number' => '', // $number - own counter
    	'offset' => 0, // $offset - own offset
    	'post_type' => $post_type,
    	'post_status' => $post_status,
    	'class' => $class,
    	'strip_tags' => $strip_tags,
    	'strip_shortcodes' => $strip_shortcodes,
    	'more_tag' => $more_tag,
    	'show_child_count' => $show_child_count,
    	'child_count_template' => $child_count_template,
    	'show_meta_key' => $show_meta_key,
    	'meta_template' => $meta_template
    );
    $list_pages = get_pages( $page_list_ext_args );
    foreach($list_pages as $page){
    	if (function_exists('get_the_post_thumbnail')) {
    		if( get_the_post_thumbnail($page->ID) ){
    			$list_pages_html .= '<div><a href="'.$link.'" title="'.esc_attr($page->post_title).'">';
    			$list_pages_html .= get_the_post_thumbnail($page->ID, array($image_width,$image_height));
    			$list_pages_html .= '</a></div> ';
    		}
    	}
    	$list_pages_html .= '<h3><a href="'.$link.'" title="'.esc_attr($page->post_title).'">'.esc_attr($page->post_title).'</a></h3>';
    }
    $list_pages_html .= '<div>'."\n".$list_pages_html."\n".'</div>';
    echo $list_pages_html;

    Simmilar code you may find in source code of the Page-List plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Page-list] Displaying thumbnails instead of a list’ is closed to new replies.