Connect with us

Tips & Tricks

Styling your ordered & unordered list items into 2 columns

Published

on

In a previous post I showed you how to create a custom widget, then I showed you how to create a widget for your monthly archives, and limit the month’s that show. I am showing the past 4 months in my widget at this time.

One of my readers: Alex asked:

How did you make the archives widget to show the dates separately into two columns?

Now I will show you a CSS trick to create this effect:

First we will give the unordered list a width of 100%:

ul#archives {
	width:110%;
	}

Then we will style the <li> nested inside.

ul#archives li {
	display:inline;
	float:left;
	width:120px;
	}

And that is it. Please make sure that you clear the float after your closing </ul>.

Continue Reading
4 Comments

4 Comments

  1. Alex

    February 15, 2009 at 7:28 pm

    Thank you, man!

  2. trosor

    February 22, 2009 at 2:04 pm

    nice information

  3. cotton

    February 23, 2009 at 1:51 am

    This is great but is there away to make the list go 1-2 on the left column and then 3 & 4 on the right. I have spent ages trying to organize a list like that. I think it would make sense, if you have a list in 2 columns, you first read the left one and then the right one. Any thoughts or suggestions on this would be much appreciated

    • frosty

      February 23, 2009 at 1:50 pm

      As far as I know, I don’t know a way to do this.

You must be logged in to post a comment Login

Leave a Reply

Tips & Tricks

Add a shortcode

Published

on

This is a simple one.

/**
 * Your Blog title
 *
 */
function my_blog_title() {
	$blogname = get_bloginfo('name');
    return '<span class="blog-title">' . $blogname . '</span>';
}		  	
add_shortcode('blog-title', 'my_blog_title');

Just add this to your functions.php file and then add [blog-title] in any post or page and it will return your Blog Title. :)

Continue Reading

Tips & Tricks

Adding a external file after the first post

Published

on

How might you display a Google ad after the first post or anything you like? It is very simple. You just need to add the variable $loopcounter in the Loop. If the $loopcounter is less than or equal to 1, then include your option. Check out the code:

<?php if (have_posts()) : while (have_posts()) : the_post(); $loopcounter++; ?>

  // your loop

  <?php if ($loopcounter <= 1) { include (STYLESHEETPATH . '/you-file.php'); } ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

Pretty simple huh. Well in the $loopcounter line, you may change the include to point to any file or maybe a custom widget like so:

<?php if ($loopcounter <= 1) { dynamic_sidebar( 'Plus Post' ); } ?>

Or use your code directly in between the { & }.

Continue Reading

Tips & Tricks

A simple way to query posts

Published

on

Here is a simple way to call query_posts with an array of options. For all options you my use visit: WordPress Codex.

<?php $my_query = array('showposts' => 4, 'post__not_in' => $do_not_duplicate); ?>

    <?php query_posts($my_query); ?>
Continue Reading

Random Search Terms

Title

Recent Posts: Fully Net Worth . com

Dixie D’Amelio: More than Charli’s Sister – The Star on Her Own Stage

Dixie D’Amelio: More than Charli’s Sister – The Star on Her Own Stage

Introduction: Walk Through the Article While Charli D’Amelio might be the name everyone instantly recognizes, Dixie D’Amelio is forging her path, proving she’s not just “Charli’s older sister.” Join us as we journey through the life, achievements, and secrets of Dixie, the songbird and social media sensation who’s just getting started. Dixie D’Amelio: Bio & […]

Emmanuel Hudson Net Worth.

Emmanuel Hudson Net Worth.

Emmanuel Hudson Net Worth Introduction Emmanuel Hudson is a comedian, an actor, an entertainer, and a YouTube star who is only 29 years old. He first started his career in Atlanta, Georgia. He appeared on national TVseveral times, but the root cause of his success was the video he posted in 2012 on YouTube called […]

Nancy Pelosi net worth.

Nancy Pelosi net worth.

What is Nancy Pelosi’s net worth? Nancy Pelosi is an American politician who has a net worth close to 120 million dollars. In one of her recent disclosure of wealth, Nancy and Paul Pelosi, who is her husband, estimated that their total personal wealth falls somewhere in the range of $43 million to $202 million. […]

Faze banks Net Worth: How Rich is Faze Banks Actually?

Faze banks Net Worth: How Rich is Faze Banks Actually?

Ricky Banks, who is better known as Faze Banks, is an American Youtuber and the co-owner of the most subscribed gaming group of Call of Duty called Faze Clan which has more than 7 million subscribers. Moreover, his own channel has close to 5.5 million subscribers. Moreover, he is also credited for the formation of […]

Trending

%d