Is there a way to get a “read more” link at the end of the excerpt?
https://www.ads-software.com/plugins/category-shortcode-w-generator/
]]>Kill Performance in WP 4.0 backend. fornt end runs fast, backend need about 30″ each click.
https://www.ads-software.com/plugins/category-shortcode-w-generator/
]]>Issue: I noticed that our website stopped loading after a specific place in the page. After turning on define('WP_DEBUG', true);
in wp-config.php, we noticed this error in the location of our category short codes:
Fatal error: Call to undefined function get_field() in /wp-content/plugins/category-shortcode-w-generator/category_shortcode.php on line 207
Problem was fixed after enabling the Advanced Custom Fields plugin.
Hope this helps!
-Thomas Newman
https://idmlo.co
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>i wanted to allow the use of category__and and also to control whether the date, author, categories, and thumbs lists.
the following code worked for me
[ 415 lines of code moderated, that’s just way too much. For that many lines of code please use pastebin.com instead. ]
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>I’ve installed and implemented the plug-in successfully, however it is showing all 3 sizes of image that are in the code for the featured image instead of just the thumbnail, any idea why?
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>Installed and tested with version 3.3.1 and excerpt only shows full view.
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>Hello I hope you are having a great day ??
My question is, if I choose to only show a few excerpts from a category. Is there a way I can add a next button to show the remaining results.
This is the code I am using: [Category number=’9′ method=’excerpt’ order=’desc’ id=’11’ orderby=’date’]
Right now I am revealing 21 excerpts and I would like to break it down to groups of 9.
But when I do this, it only shows 9 with no button to view the rest.
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>Hello and good day ??
I wanted to add the sharing feature from word press’s jetpack plugin into my site, but when I do it shows them in the category short code excerpt results. I do not want them to show up in there.
How can I have the sharing buttons not show up in the category short code.
Thank you and have a marvelous day!
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>How can I customize how long the excerpt is?
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>hi, how to put space on each post? thanks
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>I noticed right away that this plugin does not use the default wordpress classes for cetegory styles. i.e. my category entries were largely unstyled or at least not styled as I would have expected them to be by default.
secondly, if you’re going to use default classnames that do not match whatever are the normal wordpress defaults for such situations, then an admin page allowing the admin to edit the styles for the classes provided would be in order.
and lastly many of the instances of the class names are unquoted in the generated html (which makes me seriously cringe)!
my $.02
]]>Hi folks,
I have edited the Category Shortcode plugin category_shortcode.php to add a manual code of Shareaholic’s SexyBookmarks. But it does not seem to work as expected. How do we insert any working social plugin to the code such that the posts pulled out from the category has the plugin code?
At the moment the posts in my index page are manually inserted with SexyBookmarks so the posts which are pulled out from the various category should also have the same SexyBookmarks. Unfortunately it appears only at the top of the page, not at the end of each post.
Here’s the edited code (extract):
$rdscf_output.='<div class=csc_post_content>' . $rdcsc_content . '</div>';
$rdscf_output.= selfserv_shareaholic() . '<div class=csc_break></div>';
$rdscf_output.='<div class=csc_break></div>';
$rdscf_output.='</div>';
endforeach;
By the way, if I use the automatic below content menu placement for SexyBookmarks, it inserts twice when I use “Posts, Pages, & Index”. I suppose it happens because the first time is for the page, the 2nd time is for each post.
Thanks in advance!
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>Hi there,
Does anyone know if it is possible to split the list into chunks so it can be sorted into columns to avoid a very very long list of posts?
e.g
Column 1,
Category posts: 1 – 10
Column 2
Category posts: 11 – 20
Column 3
Category Posts 21 – 30
Any light on the matter would be gratefully received! Best wishes
Ross
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>Ooops … I must be doing something wrong.
I placed the shortcode
[Category number=’-1′ method=’full’ order=’asc’ id=’3′ orderby=’title’]
on the page, and get this:
Fatal error: Call to undefined function get_the_post_thumbnail() in /home/content/c/h/i/chirobooks/html/wp-content/plugins/category-shortcode-w-generator/category_shortcode.php on line 157
Can someone help me figure this out?
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>Hi,
I have this plugin enabled on https://https://linuxbsdos.com. When I click on a category link, I’m taken to the first post in that category.
The changelog says that bug has been fixed in version 1.3, but I’m running version 1.3 and the latest and greatest version of WordPress.
Any clues?
TIA
]]>Hey, I think this is the best plugin – and the best method – for creating pages of posts out there. Nice job.
I modified the plugin a bit to allow the user to optionally select whether post titles are linked to the blog post or not. Just enter “0” for no and “1” for yes. I’m just starting out with php so the hack might be ugly, but I’ve tested it and all my changes are commented in the php file.
Here’s the code:
<?php
/*
Plugin Name: Category Shortcode
Plugin URI: https://creeksidesystems.com
Description: Plugin adds shortcode capability for adding posts by category to a page.
Version: 1.3
Author: Robert Drake
Author URI: https://creeksidesystems.com
*/
/*
Category Shortcode (WordPress Plugin)
Copyright (C) 2010 Robert Drake
Contact me at https://robertdrake.net or https://creeksidesystems.com or https://servusamanu.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
//define plugin defaults
DEFINE('rd_method', 'full');
DEFINE('rd_number_of_posts', '1');
DEFINE('rd_category_id', '1');
DEFINE('rd_orderby', 'post_date');
DEFINE('rd_order', 'DESC');
DEFINE('rd_use_links', '1'); //added by Tim Day
//add the shortcode category
add_shortcode("Category", "rdCatShortCode_handler");
//print all the final output to the screen
function rdCatShortCode_handler($incomingfrompost) {
$incomingfrompost=shortcode_atts(array(
'method' => rd_method,
'number' => rd_number_of_posts,
'orderby' => rd_orderby,
'order' => rd_order,
'id' => rd_category_id,
'use_links' => rd_use_links //added by Tim Day
), $incomingfrompost);
$rdcsch_output = rdrakeCategoryShortcode_function($incomingfrompost);
return $rdcsch_output ;
}
//calculate the final output
function rdrakeCategoryShortcode_function($incomingfromhandler) {
//setup the values as input from the shortcode
$rd_loop_method = wp_specialchars_decode($incomingfromhandler["method"]);
$rd_loop_postnum = wp_specialchars_decode($incomingfromhandler["number"]);
$rd_loop_orderby = wp_specialchars_decode($incomingfromhandler["orderby"]);
$rd_loop_order = wp_specialchars_decode($incomingfromhandler["order"]);
$rd_loop_catid = wp_specialchars_decode($incomingfromhandler["id"]);
$rd_loop_use_links = wp_specialchars_decode($incomingfromhandler["use_links"]); // added by Tim Day
//check the values for validity in the get_posts function
if ( strtolower($rd_loop_method) != 'full' && strtolower($rd_loop_method) != 'excerpt' && strtolower($rd_loop_method) != "title" ) {
$rd_loop_method = 'full';
}
if ( strtolower($rd_loop_order) != 'asc' && strtolower($rd_loop_order) != 'desc' ) {
$rd_loop_order = 'desc';
}
if ( strtolower($rd_loop_orderby ) != 'author' && strtolower($rd_loop_orderby ) != 'date' && strtolower($rd_loop_orderby ) !=
'title' && strtolower($rd_loop_orderby ) != 'modified' && strtolower($rd_loop_orderby ) != 'parent' && strtolower($rd_loop_orderby )
!= 'id' && strtolower($rd_loop_orderby ) != 'rand' && strtolower($rd_loop_orderby ) != 'none' && strtolower($rd_loop_orderby ) !=
'comment_count' ) {
$rd_loop_orderby = 'date';
}
if (strtolower($rd_loop_use_links) != '0') {
$rd_loop_use_links = '1'; // added by Tim Day - sets use links flag to 1 if other than 0
}
global $post;
//grab the posts based on the criteria above
$rdcsc_posts = get_posts
('numberposts='.$rd_loop_postnum.'&order='.$rd_loop_order.'&orderby='.$rd_loop_orderby.'&category='.$rd_loop_catid.'&use_links='.$rd_loop_use_links);
$rdscf_output='';
///// -------------------------------------------------------------------------------------------///
///// ------------------------------ OUTPUT STYLING BELOW ---------------------------------------///
///// -------------------------------------------------------------------------------------------///
switch ($rd_loop_method) {
case 'excerpt':
foreach($rdcsc_posts as $post) :
setup_postdata($post);
$rdcsc_excerpt = get_the_excerpt();
/// strip tag filters added for 1.2 release
$rdcsc_excerpt = apply_filters( 'the_content', $rdcsc_excerpt );
$rdcsc_excerpt = str_replace( ']]>', ']]>', $rdcsc_excerpt );
$rdcsc_author = get_the_author();
$rdcsc_comments = get_comments();
// added in 1.3 release
$rdscf_output.='<div class=csc_post csc_excerpt>';
/// thumbnail added in 1.2 release
$rdscf_output.='<div class=csc_post_thumbnail>' . get_the_post_thumbnail($rdcsc_posts->ID,
'thumbnail') . '</div>';
// if clause to determine whether hyperlink html tags should go before and after title added by Tim Day
if ($rd_loop_use_links=='1') {
$before_title='<a href="' . get_permalink($rdcsc_posts ->ID) . '">';
$after_title='</a>';
}
else {
$before_title='';
$after_title='';
}
$rdscf_output.='<div class=csc_post_title>' . $before_title . the_title("", "", false) . $after_title . '</div>';
$rdscf_output.='<div class=csc_post_date>' . the_date('','','',FALSE) .'</div>';
$rdscf_output.='<div class=csc_post_author>' . $rdcsc_author . '</div>';
foreach((get_the_category()) as $category) {
$rdscf_output.='<div class=csc_post_category>' . $category->cat_name . '</div>';
}
$rdscf_output.='<div class=csc_post_excerpt>' . $rdcsc_excerpt . '</div>';
$rdscf_output.='<div class=csc_break></div>';
$rdscf_output.='</div>';
endforeach;
break;
case 'title':
foreach($rdcsc_posts as $post) :
setup_postdata($post);
$rdcsc_excerpt = get_the_excerpt();
$rdcsc_author = get_the_author();
$rdcsc_comments = get_comments();
// added in 1.3 release
// if clause to determine whether hyperlink html tags should go before and after title added by Tim Day
if ($rd_loop_use_links=='1') {
$before_title='<a href="' . get_permalink($rdcsc_posts ->ID) . '">';
$after_title='</a>';
}
else {
$before_title='';
$after_title='';
}
$rdscf_output.='<div class=csc_post_title>' . $before_title . the_title("", "", false) . $after_title . '</div>';
$rdscf_output.='<div class=csc_post_date>' . the_date('','','',FALSE) .'</div>';
$rdscf_output.='<div class=csc_post_author>' . $rdcsc_author . '</div>';
foreach((get_the_category()) as $category) {
$rdscf_output.='<div class=csc_post_category>' . $category->cat_name . '</div>';
}
$rdscf_output.='<div class=csc_break></div>';
endforeach;
$rdscf_output.='</div>'; // Moved to after the endforeach for formatting by Tim Day
break;
case 'full':
foreach($rdcsc_posts as $post) :
setup_postdata($post);
$rdcsc_content = get_the_content();
/// strip tag filters added for 1.2 release
$rdcsc_content = apply_filters( 'the_content', $rdcsc_content );
$rdcsc_content = str_replace( ']]>', ']]>', $rdcsc_content );
$rdcsc_author = get_the_author();
$rdcsc_comments = get_comments();
// added in 1.3 release
$rdscf_output.='<div class=csc_post csc_full>';
/// thumbnail added in 1.2 release
$rdscf_output.='<div class=csc_post_thumbnail>' . get_the_post_thumbnail($rdcsc_posts->ID,
'thumbnail') . '</div>';
// if clause to determine whether hyperlink html tags should go before and after title added by Tim Day
if ($rd_loop_use_links=='1') {
$before_title='<a href="' . get_permalink($rdcsc_posts ->ID) . '">';
$after_title='</a>';
}
else {
$before_title='';
$after_title='';
}
$rdscf_output.='<div class=csc_post_title>' . $before_title . the_title("", "", false) . $after_title . '</div>';
$rdscf_output.='<div class=csc_post_date>' . the_date('','','',FALSE) .'</div>';
$rdscf_output.='<div class=csc_post_author>' . $rdcsc_author . '</div>';
foreach((get_the_category()) as $category) {
$rdscf_output.='<div class=csc_post_category>' . $category->cat_name . '</div>';
}
$rdscf_output.='<div class=csc_post_content>' . $rdcsc_content . '</div>';
$rdscf_output.='<div class=csc_break></div>';
$rdscf_output.='</div>';
endforeach;
break;
}
wp_reset_query();
$rdscf_output.='';
return $rdscf_output;
}
//add Category Shortcode to the tools menu
add_action('admin_menu', 'rdcsc_plugin_menu');
function rdcsc_plugin_menu() {
add_management_page('Category Shortcode', 'Category Shortcode', 'administrator', 'rdcsc', 'rdcsc_admin_print');
$rdcsc_stylefile = WP_PLUGIN_URL . '/category-shortcode/style.css';
wp_register_style('rdcsc_style', $rdcsc_stylefile);
wp_enqueue_style( 'rdcsc_style');
}
?>
<?php
function rdcsc_admin_print() {
?>
<SCRIPT LANGUAGE="JavaScript">
function calcShortcode (form) {
//get values
var rdjs_Number = form.rdcsc_admin_number.value;
var rdjs_Order = form.rdcsc_admin_order.value;
var rdjs_Orderby = form.rdcsc_admin_orderby.value;
var rdjs_Method = form.rdcsc_admin_method.value;
var rdjs_Category = form.rdcsc_admin_category.value;
var rdjs_Use_Links = form.rdcsc_admin_use_links.value;
// last var added by Tim Day
//if there is no input default the code to show total posts. If 0 is output set it to use the page default
if (rdjs_Number == false) {
if (rdjs_Number != '0') {
rdjs_Number = -1;
}
}
// commented next section out for troubleshooting
var rdjs_Calculated_Code = "[Category number='" + rdjs_Number + "' method='" + rdjs_Method + "' order='" + rdjs_Order + "' id='" + rdjs_Category + "' orderby='" + rdjs_Orderby + "' use_links='" + rdjs_Use_Links + "']";
//the next section is the original code
/*
var rdjs_Calculated_Code = "[Category number='" + rdjs_Number + "' method='" + rdjs_Method + "' order='" + rdjs_Order + "' id='" + rdjs_Category + "' orderby='" + rdjs_Orderby + "']";
*/
//print the calculated code
document.getElementById("calculated_code").innerHTML= (rdjs_Calculated_Code);
};
</SCRIPT>
<div class='wrap'>
<h2>Category Shortcode Generator</h2>
<form name='rdcsc_form' method='POST'>
<div class='rdcsc_notes'>Enter 0 to display the page default number of posts. Enter nothing to display the total number of
matching posts.</div>
<div class='form-field'>
<span class='label'><label for='rdcsc_number'><?php _e('Number of Posts (Optional)') ?></label></span>
<input type='text' class='numberofposts' name='rdcsc_admin_number' style='width: 200px'/>
</div>
<div class='form-field'>
<span class='label'><label for='rdcsc_order'><?php _e('Order') ?></label></span>
<select class="rdcsc_select" name='rdcsc_admin_order'>
<option value='asc'>Ascending</option>
<option value='desc'>Descending</option>
</select>
</div>
<div class='form-field'>
<span class='label'><label for='rdcsc_method'><?php _e('Display Method') ?></label></span>
<select class="rdcsc_select" name='rdcsc_admin_method'>
<option value='full'>Full Post</option>
<option value='excerpt'>Excerpt</option>
<option value='title'>Title</option>
</select>
</div>
<div class="form-field">
<span class='label'><label for='rdcsc_orderby'><?php _e('Order By') ?></label></span>
<select class="rdcsc_select" name="rdcsc_admin_orderby">
<option value='author'>Author</option>
<option value='date'>Date</option>
<option value='title'>Title</option>
<option value='modified'>Modified</option>
<option value='parent'>Parent</option>
<option value='id'>Id</option>
<option value='rand'>Rand</option>
<option value='none'>None</option>
<option value='comment_count'>Comment Count</option>
</select>
</div>
<div class='form-field'>
<span class='label'><label for='rdcsc_category'><?php _e('Category') ?></label></span>
<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'rdcsc_admin_category', 'orderby' => 'name',
'selected' => $category->parent, 'hierarchical' => true)); ?>
</div>
<div class='form-field'>
<span class='label'><label for='rdcsc_use_links'><?php _e('Use Links') ?></label></span>
<input type='text' class='numberofposts' name='rdcsc_admin_use_links' style='width: 200px'/>
</div>
<div class='form-field'> <!-- Tim Day added opening <div> & modified style to add width: 200px -->
<INPUT TYPE='button' style="width: 200px" class='calculate_button' NAME='button' Value='Calculate Short Code' onClick='calcShortcode(this.form)'>
</div>
</form>
<div id='calculated_code'>
</div>
</div>
<?php
}
?>
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>I’m having trouble hiding the date, author, and category name. I see the bit about the div classes, but it’s not working for me. What exactly do I need to add to my stylesheet?
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>I’m seeing a problem when displaying dates using the “title” option.
If I display one post from a category the date displays fine.
If I display 2 posts with different publish dates and times they display fine.
If I display 2 posts, both with the same publish date (different times) the first post shows the date but the second one does not.
Is there a fix for this? Here is my shortcode:
[Category number=’1000′ method=’title’ order=’asc’ id=’5′ orderby=’Date’]
https://www.ads-software.com/extend/plugins/category-shortcode-w-generator/
]]>