Skip to content

Instantly share code, notes, and snippets.

@barbrick
barbrick / the_loop.php
Last active August 29, 2015 14:06
The Loop
<?php
$args = array();
$loop = new WP_Query($args);
?>
<?php if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?>
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content(); ?>
</div>
@barbrick
barbrick / .gitignore
Created July 22, 2014 02:24
.gitignore
### WordPress ###
wp-content/uploads/
wp-content/blogs.dir/
wp-content/upgrade/
wp-content/backup-db/
wp-content/advanced-cache.php
wp-content/wp-cache-config.php
sitemap.xml
*.log
wp-content/cache/
@barbrick
barbrick / post_title.php
Created June 2, 2014 18:33
Change the Title placeholder in WordPress post types
function change_post_title($title){
if ('post' == get_current_screen()->post_type) $title = 'Enter Post Name Here';
return $title;
}
add_filter('enter_title_here', 'change_post_title');
@barbrick
barbrick / database.yml
Created January 24, 2014 13:41
Rails MySQL Database Config
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html