This file contains hidden or 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
// use this only for the metabox script of Rilwis - http://www.deluxeblogtips.com/p/meta-box-script-for-wordpress.html#images | |
// the code below shows the image with a link to itself (to be used on thickbox overlays) | |
global $wpdb; | |
$meta = get_post_meta(get_the_ID(), 'sl_screenshots', false); | |
$meta = implode(',', $meta); | |
$images = $wpdb->get_col(" | |
SELECT ID FROM $wpdb->posts | |
WHERE post_type = 'attachment' |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 />'; | |
} | |
} |
OlderNewer