From 2cfb812782891fdc9ff60fbe3b2d6bd0cd5deb43 Mon Sep 17 00:00:00 2001 From: Max Klenk Date: Mon, 17 Feb 2014 21:14:58 +0100 Subject: [PATCH] add custom list-category-post --- library/css/style.css | 26 +++++++- list-category-posts/flatdesign.php | 102 +++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 list-category-posts/flatdesign.php diff --git a/library/css/style.css b/library/css/style.css index 68e990c..cc19a2f 100644 --- a/library/css/style.css +++ b/library/css/style.css @@ -31,4 +31,28 @@ of the styles inside media queries. .header #inner-header .heading .logo { background-image: url(../images/ieee-logo.svg); -} \ No newline at end of file +} + +.sidebar input { + background-color: rgba(0, 0, 0, 0.1); + border: none; + display: inline-block; + font-weight: bold; + padding: 5px; + color: #fff; +} + +/* + * List Category Post: custom pagination style + */ +.lcp_paginator li { + border: none !important; +} + +/* + * Sidebar Login: hide submit button + */ +#wp-submit { + display: none; +} + diff --git a/list-category-posts/flatdesign.php b/list-category-posts/flatdesign.php new file mode 100644 index 0000000..10afab0 --- /dev/null +++ b/list-category-posts/flatdesign.php @@ -0,0 +1,102 @@ +get_category_link('strong'); + +//Add 'starting' tag. Here, I'm using an unordered list (ul) as an example: +$lcp_display_output .= '
'; + +/** + * Posts loop. + * The code here will be executed for every post in the category. + * As you can see, the different options are being called from functions on the + * $this variable which is a CatListDisplayer. + * + * The CatListDisplayer has a function for each field we want to show. + * So you'll see get_excerpt, get_thumbnail, etc. + * You can now pass an html tag as a parameter. This tag will sorround the info + * you want to display. You can also assign a specific CSS class to each field. + */ +foreach ($this->catlist->get_categories_posts() as $single): + + $lcp_display_output .= '
'; + $lcp_display_output .= '
'; + + + + // $lcp_display_output .= ''; + + + + // $lcp_display_output .= ''; + if ($this->get_thumbnail($single)) { + $lcp_display_output .= $this->get_thumbnail($single); + } else { + $lcp_display_output .= ''; + } + $lcp_display_output .= '

' . $this->get_post_title($single) . '

'; + //$lcp_display_output .= '
'; + $lcp_display_output .= '
'; + + $lcp_display_output .= '
'; + + $lcp_display_output .= $this->get_excerpt($single, '', 'lcp_excerpt'); + + //$lcp_display_output .= '...' ; + + $lcp_display_output .= '
'; + + $lcp_display_output .= '
'; + $lcp_display_output .= '
'; + $lcp_display_output .= '
'; + +endforeach; + +$lcp_display_output .= 'catlist->get_morelink(); + +//Pagination +$lcp_display_output .= ''; + +$this->lcp_output = $lcp_display_output; +