December 8, 2011 admin
Wordpress
A handy little loop to show a short summary and replace
// find out your post permalink
$perma_link = get_permalink( $post->ID );
// save original post content to variable
$content = get_the_content();
// prevent tags strip | it's a bug in WordPress!
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
// throw out trimmed: content to process, read more tag, post permalink, words length
echo trim_the_content( $content, ' ', $perma_link, 8 );
?>
December 2, 2011 admin
Portfolio
A website dedicated to one thing only! Laptop Skins
December 2, 2011 admin
Portfolio
Design Concept for laptop skins website
December 2, 2011 admin
Wordpress
By default WordPress places the posts that are sticky before any other posts. But what if you want to run a query to show only the sticky’s? perhaps alongside another loop or on a custom page template?
That’s where this nice little loop can help, It outputs the last 15 sticky’s into a 250px box using H5 text.
<!-- start sticky -->
<div style="float:left;width:250px;">
<h4 class="widgettitle">The Sticky Posts</h4>
<?php
$sticky = get_option( 'sticky_posts' ); // Get all sticky posts
rsort( $sticky ); // Sort the stickies, latest first
$sticky = array_slice( $sticky, 0, 15 ); // Number of stickies to show
query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 15 ) ); // The query
if (have_posts() ) { while ( have_posts() ) : the_post(); ?>
<h5 class="smalllist"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h5>
<?php endwhile;?>
<?php } else { echo ""; }?>
</div>
<!-- end sticky -->
October 21, 2010 admin
Uncategorized
Have you ever wondered how to determine the location of your visitors via a webpage or browser?
This bit of code will look at a users IP address and range and output the information.
Usefull for making your site feel tailored to local business needs, even if you are not based in the area.
copy and paste the code below, note the part Search Engine Specialists
change this to required message, so if you lived in Doncaster, it would read – “Search Engine Specialists Doncaster”.
Enjoy!
Code:
<script type="text/javascript">// <![CDATA[
if (typeof(google.loader.ClientLocation.address.city) != null) {
document.write("Search Engine Specialists "
+ google.loader.ClientLocation.address.city + ", "
+ google.loader.ClientLocation.address.region);
}
// ]]></script>
October 20, 2010 admin
Portfolio
WordPress theme built using XMl feeds from a well known hotel booking company
October 20, 2010 admin
Uncategorized
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!