Wednesday, October 16, 2013

string cut function like excerpt in wordpress - wordpress

function string_limit_words($string, $word_limit) {
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit)
array_pop($words);
return implode(' ', $words);
}

Disable update for your plugin - wordpress

add_filter('CatPostWidget', 'dd_remove_update_nag');
function dd_remove_update_nag($value) {
unset($value->response[ plugin_basename(__FILE__) ]); return $value;
}

Standalone template query support - wordpress

include these below files to your custom template:
include_once('../../../wp-config.php');
include_once('../../../wp-load.php');
include_once('../../../wp-includes/wp-db.php');
then do query_posts() or any function that is related to WP :-)

Switch PHP version in Ubuntu OS or Zorin OS

First check where is installed your PHP by the below command: $ which php See PHP version by below command: $ php -v As I've installed P...