Archive for the 'php' Category

PHP Array to breadcrumb UL list

Breadcrumb is navigation aid used in user interfaces. It gives users a way to keep track of their locations within programs or documents.
A good breadcrumb navigation should be build with UL dan LI tag this is good for SEO tweak.
Below is the implementation in PHP scripting language, i made as a function so you [...]

Display random post in Wordpress

Display random post in Wordpress.
We can display random post with orderby=rand command, for example :

query_posts(’tag=whatever&showposts=5&offset=0&orderby=rand’);

<ul class="random-posts">
<?php query_posts(’tag=whatever&showposts=5&offset=0&orderby=rand’); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endwhile; endif; ?>
</ul>

For those of you who would like to setup some random post loops on your own site, here’s how to do it [...]