Hi there,
I’m using the wordpress plugin ‘List category posts’ ver 0.51 by Fernando Briano. I managed to alter the script a bit to include an exert of the post, which I’m happy about, but I have another 3 small issues I can’t figure out. The page I am referring to is http://www.localeyesvietnam.com/explore/north-central/hanoi/hanoi-things-to-do-2/ and I will post the version of the code at the end of the post.
Firstly, it seems to be limiting the results returned to 10 posts. I tried Ctrl-Fing ‘10’ and changing the only variable to ‘50’ but it didn’t work.
Secondly, I changed the sorting from ‘date’ to ‘name’; unfortunately it does it in reverse alphabetical order - not the way I intended.
These two probably just require someone whose eyes can read it quickly - something I can’t do yet unfortunately.
Finally, as you can see from the page I posted above, it doesn’t exactly look great - with the post name and excerpt running into one another with the same formatting. Is there a way to get the name in
styling, and leave the excerpt in
?
Thanks a million guys, I’m just not up to scratch with php and wordpress - I appreciate the help.
<?php include 'include/lcp-widget.php'; include 'include/lcp-options.php'; require_once 'include/lcp-catlistdisplayer.php'; class ListCategoryPosts{ /** * Gets the shortcode parameters and instantiate plugin objects * @param $atts * @param $content */ static function catlist_func($atts, $content = null) { $atts = shortcode_atts(array( 'id' => '0', 'name' => '', 'orderby' => 'name', 'order' => 'desc', 'numberposts' => '', 'date' => 'no', 'date_tag' => '', 'date_class' =>'', 'dateformat' => get_option('date_format'), 'date_modified' => '', 'date_modified_tag' => '', 'date_modified_class' => '', 'author' => 'no', 'author_posts_link' => 'no', 'author_tag' =>'', 'author_class' => '', 'author_posts' => '', 'template' => '', 'excerpt' => 'yes', 'excerpt_size' => '55', 'excerpt_strip' => 'yes', 'excerpt_overwrite' => 'no', 'excerpt_tag' =>'', 'excerpt_class' =>'', 'exclude' => '0', 'excludeposts' => '0', 'offset' => '0', 'tags' => '', 'exclude_tags' => '', 'currenttags' => '', 'content' => 'no', 'content_tag' => '', 'content_class' => '', 'display_id' => 'no', 'catlink' => 'no', 'catname' => 'no', 'catlink_string' => '', 'catlink_tag' =>'', 'catlink_class' => '', 'comments' => 'no', 'comments_tag' => '', 'comments_class' => '', 'starting_with' => '', 'thumbnail' => 'no', 'thumbnail_size' => 'thumbnail', 'thumbnail_class' => '', 'title_tag' => '', 'title_class' => '', 'title_limit' => '0', 'post_type' => '', 'post_status' => '', 'post_parent' => '0', 'post_suffix' => '', 'show_protected' => 'no', 'class' => 'lcp_catlist', 'customfield_name' => '', 'customfield_value' =>'', 'customfield_display' =>'', 'customfield_display_name' =>'', 'customfield_orderby' =>'', 'customfield_tag' => '', 'customfield_class' => '', 'taxonomy' => '', 'categorypage' => '', 'category_count' => '', 'morelink' => '', 'morelink_class' => '', 'morelink_tag' => '', 'posts_morelink' => '', 'posts_morelink_class' => '', 'year' => '', 'monthnum' => '', 'search' => '', 'link_target' => '', 'pagination' => 'no', 'pagination_next' => '>>', 'pagination_prev' => '< "", 'instance' => '0' ), $atts); if( $atts['numberposts'] == ''){ $atts['numberposts'] = get_option('numberposts'); } if( $atts['pagination'] == 'yes'){ lcp_pagination_css(); } $catlist_displayer = new CatListDisplayer($atts); return $catlist_displayer->display(); } } add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') ); function lpc_meta($links, $file) { $plugin = plugin_basename(__FILE__); if ($file == $plugin): return array_merge( $links, array( sprintf('%s', __('How to use','list-category-posts')) ), array( sprintf('%s', __('Donate','list-category-posts')) ), array( sprintf('%s', __('Fork on Github','list-category-posts')) ) ); endif; return $links; } add_filter( 'plugin_row_meta', 'lpc_meta', 0, 2 ); function load_i18n(){ load_plugin_textdomain( 'list-category-posts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); } add_action( 'plugins_loaded', 'load_i18n' ); function lcp_pagination_css(){ if ( @file_exists( get_stylesheet_directory() . '/lcp_paginator.css' ) ): $css_file = get_stylesheet_directory_uri() . '/lcp_paginator.css'; elseif ( @file_exists( get_template_directory() . '/lcp_paginator.css' ) ): $css_file = get_template_directory_uri() . '/lcp_paginator.css'; else: $css_file = plugin_dir_url(__FILE__) . '/lcp_paginator.css'; endif; wp_enqueue_style( 'lcp_paginator', $css_file); }