Tag Archives: wordpress

Why Design Your Own WordPress Theme?

Thoughts

If your site runs in WordPress, then you will have no doubt already encountered the concept of using WordPress ‘themes’. However, you may not be aware that there are several advantages to designing your own, should you choose to do so.

Of course, the overall purpose of implementing such themes is that they offer a means by which you are able to personalize your site, and make it appear different from the standard WordPress page design. With the majority of people having access to broadband internet from providers such as Verizon or O2, most will be able to utilize much more advanced features than the standard WordPress layout tends to offer. This can help to improve their overall experience of visiting your site – which can be something of a priority of those looking to promote a particular cause, business, or organization.
continue reading »

Output specific post from a category in WordPress

PHP Web Design

Let’s say you slice a website and need a nicely looking block in a sidebar with one recent post from certain category. Like in case with this one below: Daily Style Quote.

Logically following you need to run “the loop” and ask WordPress for just one post from just this particular category.

Here we go:


<div id="dailyStyleQuote">
    	<div id="quoteText">
      <?php query_posts('category_name=Daily Style Quote&posts_per_page=1'); ?>
      <?php while (have_posts()) : the_post();   		
  			the_content('');
		?>
        </div>
    	<div id="quoteBottom">
			<?php the_time('l, F j, Y'); ?>
<?php 
		$category_id = get_cat_ID( 'Daily Style Quote' );
    		$category_link = get_category_link( $category_id );
?>
            <a href="<?php echo $category_link; ?>">archive</a>
		</div>
        <?php endwhile; ?>
    </div>

Page permalinks in WordPress

PHP Web Design

Got myself puzzled for a bit while slicing a WordPress theme this weekend on how to get a permalink to a certain page in WordPress template, given that you know what’s page title. Use this:

<?php echo get_permalink(get_page_by_title("Page title here")->ID); ?>

So now in your template you can use like this:

<a href="<?php echo get_permalink(get_page_by_title("About")->ID); ?>">About</a>