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 | |
// Styleswitcher | |
global $post; | |
$styleswitch=get_post_meta($post->ID, 'styleswitch', true, null); | |
if ($styleswitch == "") { | |
$styleswitch="app"; | |
} | |
wp_enqueue_style('roots_styleswitch', get_template_directory_uri() . '/assets/css/'.$styleswitch.'.css', false, 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
<?php | |
// Disable WordPress updates and plugins updates | |
// @file functions.php | |
// disable updates | |
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); | |
remove_action( 'load-update-core.php', 'wp_update_plugins' ); | |
// or: Remove WordPress Update Notification | |
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 ); | |
add_filter( 'pre_option_update_core', create_function( '$a', "return 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
<?php | |
/** | |
* Wordpress hook for hiding the WP Adminbar on the front end. | |
* @file functions.php | |
*/ | |
add_filter('show_admin_bar', '__return_false'); | |
?> |
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 | |
/** | |
* @author @david | |
* replace the WordPress "large" image with the uploaded image | |
* put this in your Wordpress functions.php file: | |
*/ | |
function replace_uploaded_image($image_data) { | |
// if there is no large image : return | |
if (!isset($image_data['sizes']['large'])) return $image_data; |
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
# This tag loads the rewrite module | |
<IfModule mod_rewrite.c> | |
# enable the rewrite engine | |
RewriteEngine On | |
# Set your root directory | |
RewriteBase / | |
# Remove the .html extension | |
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.html\ HTTP | |
RewriteRule (.*)\.html$ $1 [R=301] |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php | |
*/ | |
$args = array( |
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 /* Main loop ------------------------------------------*/ ?> | |
<?php if (have_posts()) while (have_posts()): the_post(); ?> | |
<h1><?php the_title(); ?></h1> | |
<?php // get_template_part( 'content', 'home' ); ?> | |
<?php endwhile; ?> | |
<?php /* Simple alter main loop ------------------------------------------*/ ?> | |
<?php query_posts('posts_per_page=1&post_type=locations'); ?> |
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 | |
/* WP_QUERY, STANDARD | |
Because of how WordPress maintains information using global variables, | |
it's crucial that once you've crafted, executed, and processed your | |
own WP_Query function, you need to call this particular function to | |
restore information to the state that it was in prior to when you ran | |
your own query. This is so that WordPress continue looping through | |
information as needed in the template hierarchy, and so that data | |
isn't mangled or lost when rendering content later in a page | |
or on another page! |
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 | |
/** | |
* Hide parts of WP admin with CSS. Awesome! Use in functions.php | |
* CSS code gebruiken om delen van de admin voor klanten te verbergen | |
* @author @david | |
*/ | |
function david_admin_head() { | |
echo '<link href="'.get_bloginfo( 'template_url' ).'/wp-admin.css" rel="stylesheet" type="text/css">'; | |
} | |
add_action('admin_head', 'david_admin_head'); |
OlderNewer