Skip to content

Commit

Permalink
Adds author_posts_link, to show an author's page.
Browse files Browse the repository at this point in the history
Adds catname parameter to show just the category name (and not the link). Thanks user sirenAri from the forum.
Small bug fix for getting current category. Used to check against simple string, now checking against i18n'ed one.
Adds "removing bullets" to FAQ
  • Loading branch information
picandocodigo committed Jul 1, 2014
1 parent f5b1caf commit c871347
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
13 changes: 13 additions & 0 deletions doc/FAQ.md
Expand Up @@ -6,6 +6,7 @@
* [How to display lists in columns](#columns)
* [How do I display the Thumbnail next to the title?](#thumbnail)
* [How to not display the title](#no-title)
* [How do I remove the bullets from the list?](#bullets)
* [The plugin doesn't work on servers with PHP < 5](#php4)
* [Plugin could not be activated because it triggered a fatal error](#fatal-error)

Expand Down Expand Up @@ -116,6 +117,18 @@ add_filter('widget_text', 'do_shortcode');
Then just add a new text widget to your blog and use the shortcode there
as the widget's content.

##<a name="bullets"></a>How do I remove the bullets from the list?

By default the posts will be displayed inside a ul tag with the
`lcp_catlist` CSS class. So to make the bullets disappear, just add
this CSS code to your theme's stylesheet:

```css
.lcp_catlist li{
list-style: none;
}
```

##<a name="php5"></a>Does not work on servers with PHP < 5

This is true since version 0.18. If you're still using PHP 4 on your webhost, you should consider upgrading to PHP 5. WordPress 3.1 was the last version to support PHP 4, from 3.2 and forward, only PHP 5 is supported. You can still [download an older version of the plugin](https://wordpress.org/extend/plugins/list-category-posts/download/ "download an older version of the plugin") if you're using PHP 4.
Expand Down
12 changes: 10 additions & 2 deletions include/CatList.php
Expand Up @@ -419,9 +419,17 @@ public function get_comments_count($single){
}

public function get_author_to_show($single){
if ($this->params['author']=='yes'):
if ($this->params['author'] == 'yes'):
$lcp_userdata = get_userdata($single->post_author);
return $lcp_userdata->display_name;
$author_name = $lcp_userdata->display_name;
if($this->lcp_not_empty('author_posts_link') &&
$this->params['author_posts_link'] == 'yes'){
$link = get_author_posts_url($lcp_userdata->ID);
return "<a href=" . $link . " title='" . $author_name .
"'>" . $author_name . "</a>";
} else {
return $author_name;
}
else:
return null;
endif;
Expand Down
1 change: 1 addition & 0 deletions list_cat_posts.php
Expand Up @@ -54,6 +54,7 @@ static function catlist_func($atts, $content = null) {
'date_modified_tag' => '',
'date_modified_class' => '',
'author' => 'no',
'author_posts_link' => 'no',
'author_tag' =>'',
'author_class' => '',
'author_posts' => '',
Expand Down
10 changes: 9 additions & 1 deletion readme.txt
Expand Up @@ -195,6 +195,13 @@ update the plugin.
tag to wrap the author name in with `author_class` and `author_tag` (see HTML
& CSS Customization further below).

When displaying the post author, you can also display a link to the
author's page. The following parameter **only works if author=yes
is present in the shortcode**:

* **author_posts_link** - Gets the URL of the author page for the
author. The HTML and CSS customization are the ones applied to `author`.

* **dateformat** - Format of the date output. The default format is the one you've set on your WordPress settings. Example: `[catlist id=42 dateformat="l F dS, Y"]` would display the date as "Monday January 21st, 2013". Check http://codex.wordpress.org/Formatting_Date_and_Time for more options to display date.

* **excerpt** - Display the post's excerpt. Default is 'no', use `excerpt=yes` to activate it. If you don't have an excerpt in your post, the plugin will fetch this text from the content, striping its images, shortcodes and HTML tags. The limit is set by the *excerpt_size* parameter (55 words by default). If you want the automatically generated excerpt to respect your theme's allowed HTML tags, you should use `excerpt_strip=no`. If the post has an excerpt, the HTML tags are automatically stripped. If you want to overwrite the post's excerpt with an automatically generated one (may be usefull to allow HTML tags), use `excerpt_overwrite=yes`. I added this last parameter to have consistency across excerpts.
Expand Down Expand Up @@ -414,7 +421,8 @@ Template system has changed. Custom templates should be stored in WordPress them

= 0.49 =

* Adds catname parameter to show just the category name (and not the link). Thanks user sirenAri from the [forum](http://wordpress.org/support/topic/a-couple-of-suggestions-and-one-teensy-error)
* Adds `author_posts_link`, to show an author's page.
* Adds catname parameter to show just the category name (and not the link). Thanks user sirenAri from the [forum](http://wordpress.org/support/topic/a-couple-of-suggestions-and-one-teensy-error).
* Small bug fix for getting current category. Used to check against simple string, now checking against i18n'ed one.

= 0.48 =
Expand Down

0 comments on commit c871347

Please sign in to comment.