My homemade template installed in WordPress. It contains of a “big” index.php with a lot wordpress loops to fetch sites and use it as a “section” in the page instead of independent sites (except of Changelog and Design). Loops are using to fetch posts and inset them as portfolio parts or writings parts.
1 2 3 4 5 |
function get_trma_header() { ?> <div> <!-- ALL THE HTML CODE HERE --> </div> <? } |
1 2 3 4 5 |
<?php $recent = new WP_Query("page_id=57"); while($recent->have_posts()) : $recent->the_post();?> <h2 class="title"><?php the_title(); ?></h2> <h3 class="title-description"><?php the_subtitle(); ?></h3> <?php the_content(); ?> <?php endwhile; ?> |
1 2 3 4 5 6 7 8 |
<?php $html = '<li><a href="#filter" data-option-value="*" class="selected">All Projects</a></li>'; $tags = get_tags(); foreach ($tags as $tag) { $html .= '<li><a href="#filter" data-option-value=".'.$tag->name.'">'.$tag->name.'</a></li>'; } echo $html; ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php $projects = new WP_Query("category_name=portfolio"); while($projects->have_posts()) : $projects->the_post(); // Check if have thumbnail image attached to the post if ( has_post_thumbnail()) { $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full'); $tags = get_the_tags(); if ($tags) { foreach($tags as $tag) { echo ' '.$tag->name; the_post_thumbnail('portfolio-thumb'); print "\n"; } } } endwhile; ?> |