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 while( have_posts() ) : the_post(); //start of the loop ?> | |
<?php if( $wp_query->current_post%2 == 0 ) echo "\n".'<div class="twocolumnpostswrap">'."\n"; ?> | |
<?php // do post stuff here ?> | |
<?php if( $wp_query->current_post%2 == 1 || $wp_query->current_post == $wp_query->post_count-1 ) echo '</div> <!--/.twocolumnpostswrap-->'."\n"; ?> | |
<?php endwhile; //end of the loop ?> |
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 | |
$do_not_duplicate=0; //initialize $do_not_duplicate | |
if(!is_paged()): //is_paged returns true if we are on page 2,3,... So if we're on page 1 do: | |
$my_query = new WP_Query('posts_per_page=1'); // Gets the first post | |
while ($my_query->have_posts()) : $my_query->the_post(); | |
$do_not_duplicate = $post->ID; | |
// Do stuff for the first article |
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
// unregister all widgets | |
function unregister_default_widgets() { | |
unregister_widget('WP_Widget_Pages'); | |
unregister_widget('WP_Widget_Calendar'); | |
unregister_widget('WP_Widget_Archives'); | |
unregister_widget('WP_Widget_Links'); | |
unregister_widget('WP_Widget_Meta'); | |
unregister_widget('WP_Widget_Search'); | |
unregister_widget('WP_Widget_Text'); | |
unregister_widget('WP_Widget_Categories'); |
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
/* ========================================================================== | |
Ultra simple wordpress widget | |
========================================================================== */ | |
class BlogRoll extends WP_Widget { | |
public function __construct() { | |
parent::WP_Widget(false,'DISPLAY NAME','description=DISPLAY DESCRIPTION'); | |
} |
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 if ( has_post_thumbnail() ) { | |
the_post_thumbnail('thumbnail'); | |
} ?> |
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
scheme: ftp | |
host: ftp.example.com | |
username: example.com | |
password: password | |
path: hello/path | |
exclude: .gitignore dandelion.yml .DS_Store |
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
{ | |
"name": "simenschi/project", | |
"description": "My Project", | |
"keywords": ["keyword"], | |
"require": { | |
"laravel/framework": "4.0.*" | |
}, | |
"autoload": { | |
"classmap": [ | |
"path/to/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 | |
// =================================================== | |
// Load database info and local development parameters | |
// =================================================== | |
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) { | |
define( 'WP_LOCAL_DEV', true ); | |
define('WP_DEBUG', true); | |
require ('wp-config-local.php'); | |
} elseif (file_exists(dirname(__FILE__) . '/wp-config-playground.php')) { |
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
//[googlemaps] | |
function googlemaps_func( $atts ){ | |
return '<div class="Flexible-container"><div id="hartzkart"></div></div>'; | |
} | |
add_shortcode( 'googlemaps', 'googlemaps_func' ); |
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 $page = new WP_Query("page_id=8"); while($page->have_posts()) : $page->the_post();?> | |
<?php endwhile; ?> |
OlderNewer