Creating Custom Archive Pages on Thesis

by KishPress on October 7, 2011

Thesis is used by thousand of website and has a good framework. If you are the theme developer, then you should try this or even a regular website owner can think about using Thesis. One problem with Thesis is that you need to know some basics of PHP, HTML to get things working or you will have to hire a professional.

Coming to the topic of this post, if you want to show a custom page when when a user searches on your WordPress blog (Search Result Page), you can do this on your custom_functions.php.

You can even customize your home page, remove sidebars and do almost everything that you want to do. If you are good in designing then you can do great things using Thesis.

My problem is that I am not at all good in designing, but I can code. I have used Thesis on one of my personal website, you can check the design there.

$loopty_loop = new my_loops;

class my_loops extends thesis_custom_loop {
	function search() {
		thesis_archive_intro();
		echo "<div class=\"post_box top\">\n";
		echo "\t<div class=\"format_text\">\n";
		if ( !is_user_logged_in()) : ?>
			<div style="margin:5px 0px 5px 25px;">
				<script type='text/javascript'>
				GA_googleFillSlot("iphone_archive_top_468_60");
				</script>
			</div>
			<?php
			endif;
		echo "\t\t<ul>\n";
		while (have_posts()) {
			the_post(); ?>
			<div style="margin:0px 0px 5px 0px;padding:5px;">
				<?php $thumb=get_the_thumb(48,48); ?>
		   		<h3 style="margin-top:-5px;font-size:14px;font-weight:bold;"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
				<?php if ($thumb!='') {
			 		echo '<img style="float:right;margin:4px 0px 5px 10px;" src="'.$thumb.'" alt="'. get_the_title().'" />';
			 	}
				echo substr(strip_tags(get_the_excerpt()), 0, 150); ?>...
				</div><div style="clear:both;"></div>
			<?php
		}
		echo "\t\t</ul>\n";
		if ( !is_user_logged_in()) : ?>
			<div style="margin:5px 0px 5px 25px;">
				<script type='text/javascript'>
				GA_googleFillSlot("iphone_archive_bottom_468_60");
				</script>
			</div>
			<?php
			endif;
		echo "\t</div>\n";
		echo "</div>\n";
	}
}

You can even change all the archives pages like the tag, category, author, date, etc. You need to have functions like function tag() {} for modifying the tag page and so on.

Related posts:

  1. WordPress – Get thumbnails for your images with custom sizes If you want to display thumbnails along with the post...
  2. Adding Google Analytics Code in Thesis Theme If you are using the Thesis Theme on your blog...
  3. How to use Google Fonts for your WordPress Blog? Google fonts directory is something you should try if you...
  4. How to add a custom Header for Genesis Theme Framework? I have been using Genesis theme for sometime now. I...
  5. How to extract YouTube Thumb Image URL from a YouTube Video URL using PHP Script If you have thumbnails for your blog theme and you...

Leave a Comment

Previous post:

Next post: