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 // ** DESCRIPTION v.0.2 ** | |
if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
?><meta name="description" content="<?php | |
$descr = get_the_excerpt(); | |
$text = str_replace( "\r\n", ', ', trim($descr) ); | |
echo esc_attr($text); | |
?>" /> | |
<?php endwhile; endif; elseif(is_home()) : | |
?><meta name="description" content="<?php bloginfo('description'); ?>" /> | |
<?php endif; ?> |
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 | |
/* | |
Target: | |
******* | |
Perfect solution for a simple WP event manager | |
Needs: | |
****** |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
un petit script destiné à générer un colophon technique | |
License GPL 2.0 | |
Auteur: manuel schmalstieg | |
""" |
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
$(document).ready(function() { // The @ syntax is no longer supported in JQuery 1.3+. | |
$("a[href^=http]").each( | |
function(){ | |
if(this.href.indexOf(location.hostname) == -1) { | |
$(this).attr('target', '_blank'); | |
} | |
} | |
) | |
}); |
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 | |
$weblinks = get_post_meta($post->ID, 'Web-Link', false); | |
// false = will return an array of results | |
if ($weblinks) { | |
?> | |
<div class="hyperlinks"> | |
<?php | |
foreach($weblinks as $weblink) { |
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
// vimeo helper function | |
// Curl helper function | |
// based on this example | |
// https://github.com/vimeo/vimeo-api-examples/blob/master/simple-api/simple/simple.php | |
// detailed explanations are in this post: | |
// http://ms-studio.net/2012/notes/using-the-vimeo-api-in-wordpress/ | |
function curl_get($url) { | |
$curl = curl_init($url); |
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
// Image Toolbox | |
// ****************************** | |
// based on http://digwp.com/2009/08/awesome-image-attachment-recipes-for-wordpress/ | |
function image_toolbox($size = 'thumbnail', $howmany = -1, $link = 'no', $list = 'no') { | |
if ( $images = get_children ( array ( | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'numberposts' => $howmany , // -1 = show all | |
'post_status' => null, |
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
if($post->post_content != "") { | |
// the post HAS some content ... | |
?> | |
<a href="<?php the_permalink();?>"><?php the_title();?></a> | |
<?php | |
} else { | |
// the post is EMPTY ... | |
the_title(); | |
} |
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
function attachment_toolbox() { | |
global $post; | |
if($attachments = get_children(array( | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'numberposts' => -1, // -1 = show all | |
'post_status' => null, | |
'post_mime_type' => 'application', | |
// 'post_mime_type' => 'application/msword,application/pdf', | |
'orderby' => 'menu_order', |
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
// paste this function into your functions.php file | |
function image_toolbox_array($size = 'thumbnail', $howmany = -1) { | |
if ( $images = get_children ( array ( | |
'post_parent' => get_the_ID(), | |
'post_type' => 'attachment', | |
'numberposts' => $howmany , // -1 = show all | |
'post_status' => null, | |
'post_mime_type' => 'image', | |
'orderby' => 'menu_order', |
OlderNewer