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 | |
/** | |
* Convert a comma separated file into an associated array. | |
* The first row should contain the array keys. | |
* | |
* Example: | |
* | |
* @param string $filename Path to the CSV file | |
* @param string $delimiter The separator used in the file | |
* @return 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 | |
/* Featured Image Metabox : change the text in the current metaboxes | |
/* -------------------------------------------------- */ | |
add_filter( 'admin_post_thumbnail_html', function( $content ) { | |
if(get_post_type() == 'post') { | |
$content = str_replace('Uitgelichte afbeelding', 'Nieuws foto', $content); | |
// $content .= '<p>Een extra uitlegtekst.</p>'; | |
} elseif(get_post_type() == 'page') { | |
$content = str_replace('Uitgelichte afbeelding', 'Header foto', $content); |
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 certain admin sections for "simple users" | |
/* -------------------------------------------------- */ | |
add_action('wp_dashboard_setup', function() { | |
if( current_user_can('editor') ) { | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); //Quick Press widget | |
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); //Recent Drafts | |
remove_meta_box('dashboard_primary', 'dashboard', 'side'); //WordPress.com Blog | |
remove_meta_box('dashboard_secondary', 'dashboard', 'side'); //Other WordPress News | |
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); //Incoming Links |
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 | |
//includes all felxo_theme_file_css | |
function flexo_theme_file(){ | |
//inculde CSS file | |
wp_register_style('bootstrap', get_template_directory_uri(). '/css/bootstrap.min.css', array(), '3.1.0',all); | |
wp_register_style('fancybox', get_template_directory_uri(). '/css/fancybox/jquery.fancybox.css', array(), '3.1.0',all); | |
wp_register_style('jcarousel', get_template_directory_uri(). '/css/jcarousel.css', array(), '3.1.0',all); |
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 | |
//includes all felxo_theme_file_css | |
function flexo_theme_file(){ | |
//include jS file | |
wp_enqueue_script('jquery'); | |
wp_enqueue_script('easing-js', get_template_directory_uri(). '/js/jquery.easing.1.3.js', array('jquery'), '1.3', true); |
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 ec_child_google_maps_api() { ?> | |
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDRYczTDT6kSz-bWGrLGh6WCaBgUSL-1Dk" type="text/javascript"></script> | |
<?php } | |
add_action( 'wp_footer', 'ec_child_google_maps_api', 10 ); |
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
<html <?php language_attributes();?>> | |
<meta charset="<?php bloginfo('charset');?>"> | |
<title><?php wp_title( '|', true, 'right' ); ?></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
/******************************* | |
ADD ACF TO SEARCH RESULTS | |
*******************************/ | |
/* Join posts and postmeta tables: http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join */ | |
function cf_search_join( $join ) { | |
global $wpdb; | |
if ( is_search() ) { | |
$join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id '; |
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
//Redirect a page using a filter | |
add_filter('get_the_permalink','my_permalink_redirect'); | |
function my_permalink_redirect($permalink) { | |
global $post; | |
if ($post->ID == your_post_id_here) { //Page ID you want to redirect | |
$permalink = 'http://new-url.com/pagename'; //Redirect destination page | |
} | |
return $permalink; | |
} |
NewerOlder