Skip to content

Instantly share code, notes, and snippets.

@willybahuaud
Last active August 29, 2015 14:12
Show Gist options
  • Save willybahuaud/c9a4ed51b55d1c61d407 to your computer and use it in GitHub Desktop.
Save willybahuaud/c9a4ed51b55d1c61d407 to your computer and use it in GitHub Desktop.
WTF ??
<?php
/*
Template Name: Homepage
*/
function lol_head() {
echo "
<!--<script src='".get_bloginfo( 'url' )."/wp-content/themes/lol/jquery-1.5.1.min.js' type='text/javascript'></script>-->
<script src='".get_bloginfo( 'url' )."/wp-content/themes/lol/jquery.divslideshow-1.2.js' type='text/javascript'></script>
<link rel='stylesheet' type='text/css' href='".get_bloginfo( 'url' )."/wp-content/themes/lol/externe/divslideshow.css'>
";
}
add_action('wp_head', 'lol_head');
get_header();
global $wpdb;
$sql = "SELECT post_title, id, post_content
FROM wp_posts
WHERE (post_type = 'post' OR post_type = 'page')
AND post_status = 'publish'
ORDER BY wp_posts.post_date DESC
LIMIT 3";
$actus = $wpdb->get_results($sql);
foreach ($actus as $actu) {
$news.="<li><a href='".get_permalink($actu->id)."'>".$actu->post_title."</a><span class='actuhomecontent'><br />".substr(strip_tags($actu->post_content),0, 225)." [...]</span></li><div class='breaker'></div>";
}
echo eregi_replace("\[get_last_news_blog\]", "<ul id=\"actuhome\">".$news."</ul>", get_the_content("2676") );
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment