TwentyEleven Sidebar on Single Posts

Some WordPress themes single posts do not include the side bar on single post. For the WordPress 2011 default themes TwentyEleven, it was one of it. Below is the 2 file need to edit to make the side bar appear in TwentyEleven single posts page.

(1) single.php

Add the link get_sidebar above of get_footer as below

<?php get_sidebar(); ?>
<?php get_footer(); ?>

(2) style.css

Add below css style in the css file

.singular #primary {
margin: 0 -26.4% 0 0;
}

#nav-single {
display: none;
}

.singular .entry-header .entry-meta {
position: relative;
}

.singular .hentry {
padding: 0;
}

.singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title {
width: 100%;
}

.singular #content, .left-sidebar.singular #content {
margin: 0 34% 0 7.6%;
}

.singular article .entry-title {
padding-top: 0;
}

.singular .entry-meta .edit-link a {
right: 0;
top: 0;
left: auto;
}

How to Delete ALL Unapproved WordPress Comments

*Please backup WordPress database before you done all the step as below

1. Go to phpmyadmin in your control panel (based on your hosting plan)

2. Click your Word Press database link

3. Click on the comments table (You can click browse to view all the approved and unapproved comments)

4. Click the mySQL tab. This will open up a query box. Delete the default query and type in:

DELETE FROM wp_comments WHERE comment_approved = 0

5. Click go, this will delete all the unapproved comments

Joomla Force SSL?

Joomla Force SSL, a good features or bad features? Only the user can determine it. But for me, it just another features that give trouble for user. Some Joomla amateur think once enable it, the site will auto have SSL. The truth is it bring lot of issue cause once you enable it in admin panel, you are unable to revert it back cause you are unable to access to admin panel.

So you need to go to configuration.php and edit it from

var $force_ssl = ‘1’;

to

var $force_ssl = ‘0’;

Then, you able to access again.

Thanks god, Joomla, please remove this features, we do not need that.

How To Add WP-PageNavi to Twenty Eleven WordPress Theme ?

PageNaviIs a WordPress Plugin that show page in your themes. It was a great plugin for me so far as I have many page on my blog. This post is all about how to add the WP-PageNavi to Twenty Eleven WordPress Theme. Easy and Straight forward.

(1) Open functions.php of twenty eleven

(2) Locate code as below

function twentyeleven_content_nav( $nav_id ) {
        global $wp_query;

        if ( $wp_query->max_num_pages > 1 ) : ?>
                <nav id="<?php echo $nav_id; ?>">
                        <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
                        <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div>
                        <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div>
                </nav><!-- #nav-above -->

(3)after that line, replace div class=”nav-previous” and div class=”nav-next” with

<?php wp_pagenavi(); ?>

After edit, code will as below

function twentyeleven_content_nav( $nav_id ) {
        global $wp_query;

        if ( $wp_query->max_num_pages > 1 ) : ?>
                <nav id="<?php echo $nav_id; ?>">
                        <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
                        <?php wp_pagenavi(); ?>
                </nav><!-- #nav-above -->