Posts Tagged ‘Wordpress’

www.sport-akustik.at

Wednesday, February 1st, 2012

Since 2009 i worked for Franz Quitt of Sport- und Akustikbau Limited. He is expert on acoustic halls and the inner covering of sports buildings. I digitalize his scribbles and incidentally took the existing webpage of Lisa Schlichting hosted and improved it. Finally we decided to develope a new site to improve the Range. It was build with wordpress.
www.sport-akustik.at.

KEYFACTS

Client: Ing. Franz Quitt
Branch: Acoustic and Sport Hall’s
SEO Result: Good
In one word: Finally

TASKS

Screen design
Information design
Usability
Implementation
SEO
Google Analytics

TECHNIQUE

WordPress
DHTML
CSS
PHP

Sportbau Akustikbau Limited

Current Category and List of Posts included (WordPress)

Wednesday, January 12th, 2011
<?php 
//Identify current Post-Category-ID ermitteln
foreach((get_the_category()) as $category) 
	{ 
	$postcat= $category->cat_ID; 
	$catname =$category->cat_name;
	} 
?>
<h2><?php echo $catname; ?></h2>
<?php $categories = get_categories("child_of=$postcat"); 
	foreach ($categories as $cat) 
	{ ?>
	<?php query_posts("cat=$cat->cat_ID&posts_per_page=-1"); ?>
	<h3><?php single_cat_title(); ?></h3>
	<?php while (have_posts()) : the_post(); ?>
	<ul>
		<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
			<?php the_title(); ?></a>
		</li>
	</ul>
	<?php endwhile; ?>
	<?php } ?>
<?php } ?>

This code snippet for wordpress works within the category.php. It writes the current category and below a list of the posts included dynamically.

Example:
Category A
Post 4 of Subcategory A
Post 3 of Subcategory A
Post 2 of Subcategory A
Post 1 of Subcategory A

Category title and Posts included (WordPress)

Wednesday, January 12th, 2011
<div  id="subnavigation" >
<?php
	$temp_category = single_cat_title('',false);
	if (!empty($temp_category)){
	// give index
?>
<h2><?php single_cat_title(); ?></h2>
	<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
		<h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
	<?php endforeach; else: ?>
	<?php _e('Sorry, no posts matched your criteria.'); ?>
	<?php endif; ?>
	<?php
}else{ // give details or single post
?>
...... code 4 normal post overview
<?php
}
?>
</div>
	

This code snippet for wordpress works within the category.php. It writes the current category and below a list of the posts included.

Example:
Subcategory A
Post 4 of Subcategory A
Post 3 of Subcategory A
Post 2 of Subcategory A
Post 1 of Subcategory A

Last post’s excerpt on category.php (WordPress, php)

Tuesday, January 11th, 2011
<?php
	foreach((get_the_category()) as $category) 
	{ 
		$postcat= $category->cat_ID; 
		$catname =$category->cat_name;
	} 	

	query_posts("cat=$cat->cat_ID&posts_per_page=1");
?>
<a href="<?php the_permalink() ?>">
	<?php the_excerpt('more_link_text', strip_teaser, 'more_file'); ?>
</a>



	

This code snippet for wordpress works within category.php. It simply shows the last post’s excerpt in the current category
e.g. a picture or a meaningful text.

Snippet: Yearly Posts with Excerpt (Archive, WordPress, PHP)

Thursday, April 15th, 2010

<?php for($newdate = date("Y"); $newdate>=2005; $newdate=$newdate-1) { ?>
<div style="clear:both;" >
	<h1><?php echo $newdate." ";  ?></h1>
	<?php query_posts("cat=63&year=$newdate" ); ?>
	<?php while (have_posts()) : the_post(); ?>
		<div  style="width:200px; float:left; height:170px;">
			<?php the_excerpt('more_link_text', strip_teaser, 'more_file'); ?> 
			<h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to  <?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h4>
		</div>
	<?php endwhile; ?>
</div>
<?php } ?>

After installing and uninstalling severall plugins in WordPress for different purposes I decided to write my first php/wordpress loop for a specific need.

I use post-excerpts for my Category-Overview Sites, displaying the thumbnail-image of the post and the Title – both clickable.

For my EXHIBIT HIGHTLIGHT section which is -short to say- a photo- and videoblog i needed a solution to display this excerpts ordered by year. Some sort of a category archive.

Simply a loop for the year ending with the first post-blog and beginning with the current year. As you can see on the right side i found a easy and simple way. The code is also easy to adapt for your needs or to develop.

If you use and adapt the code, please post your solution in the comment line. Maybe it will expand and i could develop a universal archive plugin.