How to add suggest plugin to theme?

TGM Plugin Activation is the most popular PHP library among WordPress theme developers to allows them to easily require or recommend plugins for your WordPress themes (and plugins). It allows your users to install, update and even automatically activate plugins in singular or bulk fashion using native WordPress classes, functions and interfaces

How to add multiple custom widget areas

You have to register multiple areas: function new_sidebar_widget_init() { register_sidebar( array( ‘name’ => ‘new-sidebar’, ‘id’ => ‘new-sidebar’, ‘before_widget’ => ‘<div id=”new-sidebar”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ”, ‘after_title’ => ”, ) ); register_sidebar( array( ‘name’ => ‘new-sidebar-1’, ‘id’ => ‘new-sidebar-1’, ‘before_widget’ => ‘<div id=”new-sidebar”>’, ‘after_widget’ => ‘</div>’, ‘before_title’ => ”, ‘after_title’ => ”, ) ); … Read more

Similar Posts – NO plugin

Put this in your single.php: $tags = wp_get_post_tags($post->ID); if ($tags) { $first_tag = $tags[0]->term_id; $args=array( ‘tag__in’ => array($first_tag), ‘post__not_in’ => array($post->ID), ‘showposts’=>4, ‘caller_get_posts’=>1 ); $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); // post content stuff here endwhile; wp_reset_query(); } }

Unwanted blank lines before tag

the_content doesn’t affect the DOCTYPE and <html> tags, only the post/page content. One of your plugins, or something else in the theme is either throwing an error, or is printing something earlier than it should. Have you tried: Disabling each plugin one by one and see when it is fixed. Editing wp-config.php and adding define( … Read more

Change date number to another language/script?

Please try this way: Change date, the_date, the_time to get_date, get_the_date, get_the_time. function KhmerNumDate ($text) { $text = str_replace(‘1’, ‘១’, $text); $text = str_replace(‘2’, ‘២’, $text); $text = str_replace(‘3’, ‘៣’, $text); $text = str_replace(‘4’, ‘៤’, $text); $text = str_replace(‘5’, ‘៥’, $text); $text = str_replace(‘6’, ‘៦’, $text); $text = str_replace(‘7’, ‘៧’, $text); $text = str_replace(‘8’, ‘៨’, … Read more

Enqueued Stylesheets Effecting Admin Styles

You could do it like this: function theme_styles(){ /* * This if() statement is unnecessary, as wp_enqueue_scripts * doesn’t fire on the admin pages. * if( is_admin() ) { * return; * } */ wp_enqueue_style( ‘theme-styles’, get_template_directory_uri() . ‘/css/all.css’, array(), false, ‘all’ ); } add_action( ‘wp_enqueue_scripts’, ‘theme_styles’ ); References is_admin() Also, note that the wp_enqueue_scripts … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)