If this is my shortcode in WordPress:
[catlist name='mycategory', template='category-display-template' excerpt='yes']
How can I get the name value to display in my WordPress page? I were thinking of something in the lines of <?php echo $name ?>
Any help would be appreciated.
The plugin code looks like this - here is an extract of the code:
function catlist_func($atts, $content = null) {
$atts = shortcode_atts(array(
'id' => '0',
'name' => '',
'category_name' => '',
'orderby' => 'date',
'order' => 'desc',
'numberposts' => '5',
'date' => 'no',
'author' => 'no',
'dateformat' => get_option('date_format'),
'template' => 'default',
'excerpt' => 'no',
'exclude' => '0',
'excludeposts' => '0',
'offset' => '0',
'tags' => '',
'content' => 'no',
'catlink' => 'no',
'comments' => 'no',
'thumbnail' => 'no',
'thumbnail_size' => 'thumbnail',
'post_type' => '',
'post_parent' => '0',
'class' => 'lcp_catlist',
'customfield_name' => '',
'customfield_value' =>'',
'customfield_display' =>'',
'taxonomy' => ''
), $atts);
$catlist_displayer = new CatListDisplayer($atts);
return $catlist_displayer->display();
}
add_shortcode( 'catlist', array('ListCategoryPosts', 'catlist_func') );
It is similar to the code provided by Oleksandr Bernatskyi
How do I call the 'name' in this page I have placed the text Need to call it here in the code below where I want the name to be inserted...
$lcp_display_output .= '<a href="'.get_permalink($single).'" title="'.get_the_title($single).'" class="medium magenta awesome">Read More »</a> '.Need to call it here.' <a href="'.get_category_link($single).'" title="'.get_the_title($single).'" class="medium magenta awesome">Category »</a><div class="category-clear"></div>';
or the name is actually the "category of the page"
- How can I get the name to display either "name" or "category name"
- How can I link to the category page?
I am using this wordpress plugin http://wordpress.org/extend/plugins/list-category-posts/
------------------ Or a simplified solution to what I want to accomplish might be this ------
This is the shortcode of how I call the function in the plugin:
[catlist name='Alfa Romeo' template='category-display-template' excerpt='yes' thumbnail='yes' numberposts='1' author='yes' category_name='Alfa Romeo' URL='http://3d-car-shows.com/category/alfa-romeo/']
[catlist name='BMW' template='category-display-template' excerpt='yes' thumbnail='yes' numberposts='1' author='yes' category_name='BMW' URL='http://3d-car-shows.com/category/bmw/']
Now on the plugin page if there were a easy way to pull in the Manual created "category name" and the "URL" value from the shortcode I willbe able to link to custom created pages...
Something like this
<a href="<?php echo $category_name ?>"><?php echo $URL ?></a>
Thanks.