Cannot install plugins on Centos VPS

Okay, I figured this out based upon suggestions from StackOverflow. This is how I resolved this issue: I created a group called ftpusers. groupadd ftpusers I added my wordpress user to this group. usermod -a -G ftpusers wordpressuser I changed ownership of the wordpress folder recursively to my wordpress user:group. chown -R wordpressuser:ftpusers wordpress Voila … Read more

Want wp_get_post_terms return in arbitrarily order, how to do?

add_filter(‘the_content’,’my_function’); function my_function($content){ the_post_thumbnail(‘thumbnail’, array(‘class’ => ‘top-post-img’ )); if (is_single() && in_category(‘5′)){ global $post; $term_list = wp_get_post_terms ($post->ID,’school’,array(‘fields’=>’names’)); ?> <div id=”some_class”> <span>School:<strong><?php print_r($term_list[0]); ?></strong></span> <?php if (is_single() && in_category(‘5′)){ $term_list = wp_get_post_terms ($post->ID,’article’,array(‘fields’ =>’names’)); ?> <span>Article:<strong><?php print_r($term_list[0]); ?></strong></span> <?php if (is_single() && in_category(‘5′)){ $term_list = wp_get_post_terms ($post->ID,’teacher’,array(‘fields’=>’names’)); ?> <span>Teacher:<strong><?php print_r($term_list[0]); ?></strong></span> </div> <?php return $content; … Read more

How to Delete all Unused photos Function

As a rule, I suggest you try to stick as much as possible to WordPress core functions when modifying the database, as they will handle associated data automatically – e.g. delete associated post meta, associated taxonomy info, etc. (Woocommerce stores product image data as product post_meta, see below for details.) This might slow things down … Read more

Hiding posts – WP Hide Post not working

here is a code example to hide post. However you need to use a custom meta for this to work. So, add a new meta with the post you want to hide. Use meta key name as ‘hidethis’ and use value ‘1’. Don’t use the quote marks, just the texts. Next this is to add … Read more

(WooCommerce) Remove Sidebar only on Single-Product page

The conditional tag for single products is is_product() add_action(‘template_redirect’, ‘remove_sidebar_shop’); function remove_sidebar_shop() { if ( is_product(‘add-page-i.d-here’) ) { remove_action(‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’); } } You may also want to change the layout on that product page to full width to remove the gap and reduce the width of the content area using a custom body class which … Read more