NB: gebruik hierbij de plugin Footable tbv weergave op mobiele apparaten. Ik probeerde 2 andere: SSP Stacktable Tables, en WP Responsive Table en die kregen het niet voor elkaar om een tabel met 2 kolomen waarvan de laatste een tekstkolom was, weer te geven. Footable maakt een plus teken dat je kan openklikken, de tekst is dan duect goed te lezen.
Snel aan de slag: de basis (te gebruiken shortcode/stylen/aanpassingen) Wiki
Selecteer welke berichten je wilt tonen
Nog meer parameters die je kan gebruiken: (volgorde, voorwaardelijke titel, aantal, datum, offset etc).
Voorbeeld: 1 1 2013: datum zonder voorloopnullen): [[dateformat=” j n Y “]]
Het datumveld zijn eigen layout geven:
[catlist name=blog date=yes date_tag=span date_class=datumveld]
De afgelopen 33 dagen[catlist name="plugins"="yes" after='-33 days' orderby=date order=DESC date=yes numberposts=30]
Ouder dan 33 dagen[catlist name="plugins"="yes" before='-33 days' orderby=date order=DESC date=yes]
Gebruik het bijvoorbeeld om het eerste bericht volledig te laten zien en vanaf bericht 2 alleen het excerpt (of het deel tot de more tag); gebruik numberposts=1 voor de eerste; voor de overige berichten offset=2, numberposts=-1
Ik maakte een template: eenkolomexcerpt (met 1 kolom en uittreksel)
[su_section]/* This is the string which will gather all the information.*/
$lcp_display_output = ”;
// Show category link:
$lcp_display_output .= $this->get_category_link(‘strong’);
//Add ‘starting’ tag. Here, I’m using an unordered list (ul) as an example:
$lcp_display_output .= ‘<div id=”catlijst1kolom”>’;
foreach ($this->catlist->get_categories_posts() as $single):
//Start a List Item for each post:
$lcp_display_output .= ‘<div class=”wp-cpl-sc-wrap wp-cpl-sc-theme-2″>’;
$lcp_display_output .= ‘<div class=”wp-cpl-sc-post”>’;
$lcp_display_output .= ‘<div id=”leukediv”>’;
$lcp_display_output .= ‘<div class=”wp-cpl-sc-thumba”>’;
$lcp_display_output .= ‘<table class=”footable”>’;
$lcp_display_output .= ‘<tr><td>’;
$lcp_display_output .= $this->get_thumbnail($single);
$lcp_display_output .= ‘</td>’;
$lcp_display_output .= ‘<td>’;
$lcp_display_output .= ‘<h2>’;
$lcp_display_output .= $this->get_post_title($single);
$lcp_display_output .= ‘</h2>’;
$lcp_display_output .= ‘</td></tr></table>’;
$lcp_display_output .= ‘</div>’;
$lcp_display_output .= ‘</div>’;
$lcp_display_output .= ‘<div class=”datumveld”>’;
/*$lcp_display_output .= ‘<div class=”wp-cpl-sc-date”>’; */
//Show date:
$lcp_display_output .= ‘Geplaatst op ‘ . $this->get_date($single);
/*$lcp_display_output .= ‘</div>’; */
$lcp_display_output .= ‘</div>’;
$lcp_display_output .= ‘<div class=”wp-cpl-sc-entry”>’;
$lcp_display_output .= $this->get_excerpt($single, ‘p’, ‘lcp_excerpt’);
$lcp_display_output .= ‘<p class=”wp-cpl-sc-readmore”>’;
$lcp_display_output .= ‘<a href=”‘.get_permalink($single->ID).'”>lees verder</a>’;
$lcp_display_output .= ‘</p>’;
$lcp_display_output .= ‘</div>’;
$lcp_display_output .= ‘</div>’;
$lcp_display_output .= ‘<div class=”clear”>’;
$lcp_display_output .= ‘</div>’;
$lcp_display_output .= ‘</div>’;
endforeach;
$lcp_display_output .= ‘</div>’;
$this->lcp_output = $lcp_display_output;
en gebruikte de stijl van de plugin wp-category-posts-list; die plaatste ik onderin het stijlbestand.
[su_section]#catlijst1kolom img.attachment-thumbnail {padding:10px!important;
border-radius: 4px;
display: block !important;
padding: 4px !important; text-align:right!important
float: left !important;
margin: 0px 10px 10px 0px !important;}
#catlijst1kolomContent p {clear:both!important; padding:15px!important; }
#leukediv {width:100%; float:right!important;}
#leukediv .footable td {border:none}
.datumveld {display:block!important;font-size:80%!important; font-style:italic!important;margin:3px 0!important;padding:3px!important}}
/* WP Category Post List Widget*/
.wp-cpl-widget{list-style:none!important;background:none!important}
.wp-cpl-widget li{background:none!important;float:none!important;overflow:hidden!important;margin:2px 0!important;padding:3px 5px!important}
.wp-cpl-widget li span.wp-thumb-overlay{float:left!important;line-height:0!important;margin:0 5px 0 0 !important;padding:3px!important}
.wp-cpl-teaser{font-style:italic!important;margin:0 0 5px!important;padding:5px 0 0!important}
.wp-cpl-read-more{text-align:right!important;font-style:italic!important;margin:0 0 5px!important;padding:5px 0 0!important}
.wp-cpl-comment,.wp-cpl-date,.wp-cpl-author{display:block!important;font-size:80%!important}
.wp-cpl-sc-wrap .wp-cpl-sc-post{overflow:hidden!important;margin:5px 0!important;padding:5px 10px!important}
.wp-cpl-sc-wrap .wp-cpl-sc-post .wp-cpl-sc-thumba{float:left!important; -moz-border-radius:4px;border-radius:4px;display:block!important;margin:0 10px 10px 0 !important}
.wp-cpl-sc-wrap .wp-cpl-sc-post .wp-cpl-sc-thumba .wp-cpl-sc-thumb{-moz-border-radius:4px;border-radius:4px;display:block!important;padding:4px!important}
.wp-cpl-sc-wrap .wp-cpl-sc-post h2{clear:right!important}
.wp-cpl-sc-wrap .wp-cpl-sc-post .wp-cpl-sc-meta{clear:right!important;font-size:10px!important;font-style:italic!important;overflow:hidden!important;margin:3px 0!important;padding:3px!important}
.wp-cpl-sc-wrap .wp-cpl-sc-post .wp-cpl-sc-entry{margin:3px 0!important}
.wp-cpl-sc-wrap .wp-cpl-sc-post .wp-cpl-sc-readmore{text-align:right!important;font-size:11px!important;font-style:italic!important}
.wp-cpl-widget,.wp-cpl-widget *,.wp-cpl-sc-wrap,.wp-cpl-sc-wrap *{margin:0!important;padding:0!important}
/*theme 2*/
.wp-cpl-theme-2 li span.wp-thumb-overlay{background:#A7DBD8!important;border:1px solid #69D2E7!important}
.wp-cpl-theme-2 li.wp-cpl-sticky span.wp-thumb-overlay{background:#ffbd88!important;border:1px solid #c96!important}
.wp-cpl-theme-2 li.wp-cpl-even{background:#dcf1f0!important}
.wp-cpl-theme-2 li.wp-cpl-odd{background:#eaf7f5!important}
.wp-cpl-theme-2 li.wp-cpl-sticky a{color:#F38630!important}
.wp-cpl-sc-theme-2 a{color:#366!important}
.wp-cpl-sc-theme-2 .wp-cpl-sc-sticky a{color:#f06c22!important}
.wp-cpl-sc-theme-2 .wp-cpl-sc-post h2 a{color:#033!important}
.wp-cpl-sc-theme-2 .wp-cpl-sc-sticky h2 a{color:#dd6100!important}
.wp-cpl-theme-2 li,.wp-cpl-sc-theme-2 .wp-cpl-sc-post{border:1px solid #A7DBD8!important}
.wp-cpl-theme-2 li.wp-cpl-sticky,.wp-cpl-sc-theme-2 .wp-cpl-sc-sticky{border:1px solid #FA6900!important}
.wp-cpl-sc-theme-2,.wp-cpl-sc-theme-2 .wp-cpl-sc-post .wp-cpl-sc-meta,.wp-cpl-sc-theme-2 .wp-cpl-sc-sticky .wp-cpl-sc-meta{color:#333!important}
Gebruikt en flink aangepast op de grafpagina’s van: http://www.stichtinginparadisum.nl/daa-11-04-04/Op iedere grafpagina staat:
[[ collapse="false" toolbar="false" gutter="false"]catlist name=daa-01-03-02 orderby=name order=asc date=no numberposts=-1 customfield_display=VOORNAAM ]]
De list category posts plugin geeft bij het tonen van het custom field (VOORNAAM) standaard de titel van het custom field, gevolgd door een dubbele punt en dan pas de waarde. Dit kan je aanpassen in een “core”- bestand. Let op bij updaten!
Zonder deze ingreep had hier links gestaan: VOORNAAM: P.J.
Wijzig regel 226 (comment de originele)
/*** Display custom fields.
* @see http://codex.wordpress.org/Function_Reference/get_post_custom
* @param string $custom_key
* @param int $post_id
*/
public function get_custom_fields($custom_key, $post_id){
if($this->params[‘customfield_display’] != ”):
$lcp_customs = ”;
//Doesn’t work for many when having spaces:
$custom_key = trim($custom_key);
//Create array for many fields:
$custom_array = explode(“,”, $custom_key);
//Get post custom fields:
$custom_fields = get_post_custom($post_id);
//Loop on custom fields and if there’s a value, add it:
foreach ($custom_array as $something) :
$my_custom_field = $custom_fields[$something];
if (sizeof($my_custom_field) > 0 ):
foreach ( $my_custom_field as $key => $value ) :
//$lcp_customs .= “<div class=\”lcp-customfield\”>” .
// $something. ” : ” . $value . “</div>”;
$lcp_customs .= “<div class=\”lcp-customfield\”>” . $value . “</div>”;
endforeach;
endif;
endforeach;
return $lcp_customs;
else:
return null;
endif;
}
[catlist name=petities orderby=date date=yes numberposts=-1 excerpt=yes excerpt_size=300 thumbnail=yes thumbnail_size=thumbnail customfield_display="Datum petitie indiening" template=referenties ]
Dit template maakt gebruik van #catlijst2kolommen {width:100%!important;}
De volgorde is omgedraaid: eerst thumbnail, daarna titel en ook moest er nog wat afstand tussen het plaatje en de titel komen.
Daarom een lege regel toegevoegd: width:20px en een lege regel met height:7px
Te zien op https://b2co.nl/projecten/utiliteitsbouw/ Goed responsive
[su_section parallax=”no” cover=”no” text_shadow=”0px 1px 10px #ffffff”]$lcp_display_output = ”;
// Show category link:
$lcp_display_output .= $this->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.
*/
$lcp_display_output .= ‘
‘;foreach ($this->catlist->get_categories_posts() as $single):
//Start a List Item for each post://Post Thumbnail$lcp_display_output .= ”;//thumbnail:
$lcp_display_output .= ”;
//leeg vak:
$lcp_display_output .= ”;//Show the title and link to the post:
$lcp_display_output .= ”;/**
* Post content – Example of how to use tag and class parameters:
* This will produce:The content*/$lcp_display_output .= ”;/**
* Post content – Example of how to use tag and class parameters:
* This will produce:The content*/
$lcp_display_output .= ”;
$lcp_display_output .= ”;
$lcp_display_output .= ”;$lcp_display_output .= ”;endforeach;
$lcp_display_output .= ‘
‘; //Show date: $lcp_display_output .= ‘ ‘ . $this->get_date($single);$lcp_display_output .= ‘ | ‘; $lcp_display_output .= $this->get_thumbnail($single); $lcp_display_output .= ‘ | ‘; $lcp_display_output .= ‘ | ‘; $lcp_display_output .= $this->get_post_title($single); $lcp_display_output .= ‘ | ‘; $lcp_display_output .= $this->get_content($single, ‘p’, ‘lcp_content’); $lcp_display_output .= ‘ | ‘; $lcp_display_output .= $this->get_excerpt($single, ‘p’, ‘lcp_excerpt’); $lcp_display_output .= ‘ |
‘;
$lcp_display_output .= ‘
‘;
$this->lcp_output = $lcp_display_output;
1e kolom: titel 2e kolom: 2e rij: plaatje; 2e rij: inhoud (excerpt)
Het gaat om deze 2 toevoegingen: excerpt_overwrite=no excerpt_strip=no excerpt=yes excerpt_size=200
Standaard wordt de tekst afgekapt, HTML blijft behouden. Dat is niet altijd mooi, bijvoorbeeld als er een groot plaatje wordt vertoond. Voor die gevallen, maak je zelf een samenvatting die louter tekst bevat.
Ook toegepast bij dit voorbeeld: Lees verder.
Eigen template gemaakt:
/* lijsten */
#catlijsten td {border-bottom: none; padding: 0px;}
#catlijsten td.titel a{text-decoration:none!important; color:green; font-weight:bold}
[/css]