This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Template Name: Testimonials */ | |
get_header(); ?> | |
<div class="page-header"> | |
<h1 class="page-title"> | |
<?php _e( 'Testimonials', 'basejump' ); ?> | |
</h1> | |
</div><!-- end .page-header --> | |
<div <?php post_class(); ?>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// the following will be part of your loop. | |
?> | |
<div class="ContentFlow"> | |
<div class="flow"> | |
<?php | |
$asliders = query_posts('post_type=artist&posts_per_page=-1'); | |
if ($asliders) { | |
foreach ($asliders as $aslider) { | |
// my original code included a checkbox custom metabox "_artist_slider", the code below calls these metadat and checks whether this box has been ticked ("on"). If your site doesn't use any metaboxes to condtionally show the post in the slider, then you need to delete the "if ($meta == 'on')" condition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //display a message on older posts | |
function older_post_message () { | |
$posted = get_the_time('U'); | |
$current = current_time('timestamp'); | |
//Convert difference in seconds to days | |
$diffTime = ($current - $posted) / (60*60*24); | |
if($diffTime > 365){ | |
echo '<div class=older-post-message>' . __('This post was written more than a year ago and <em>might</em> not be entirely accurate anymore.', 'text-domain') . '</div><br />'; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pageChildren = get_pages('sort_column=menu_order&hierarchical=0&child_of='.$post->ID); | |
if ( $pageChildren ) { | |
foreach ( $pageChildren as $pageChild ) { | |
echo '<div class="page-excerpt-wrapper">'; | |
echo '<h2>'. $pageChild->post_title.'</h2>'; | |
if ($pageChild->post_excerpt){ | |
echo '<p>'.$pageChild->post_excerpt.'</p>'; | |
} | |
echo '</div>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>One column full width content</p> | |
<div class="one-half first">Two columns full width content </div> | |
<div class="one-half">Two columns full width content </div> | |
<div class="one-third first">Three columns full width content </div> | |
<div class="one-third">Three columns full width content </div> | |
<div class="one-third">Three columns full width content </div> | |
<div class="one-fourth first">Four columns full width content </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add the following lines to the functions.php file of your theme | |
function wpml_language_switch() { | |
$lang = icl_get_languages('skip_missing=N'); | |
$ret = ''; | |
if(count($lang) > 0) { | |
foreach($lang as $value) { | |
$ret .= ($value['active'] == 0) ? '<li class="language dropdown menu-item"><a href="' . $value['url'] . '">' . | |
$value['native_name'] . '</a></li>' : ''; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//ADD NEW DEFAULT HEADER IMAGES | |
function wptips_new_default_header_images() { | |
$child2011_dir = get_bloginfo('stylesheet_directory'); | |
register_default_headers( array ( | |
'image1' => array ( | |
'url' => "$child2011_dir/images/banner1.jpg", | |
'thumbnail_url' => "$child2011_dir/images/image1-thumb.jpg", // 230 x 66px | |
'description' => __( 'Image Description', 'child2011' ) | |
) // the last image does not get a comma |