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 draw_gallery() { | |
if( get_query_var('page') ) { | |
$page = get_query_var( 'page' ); | |
} else { | |
$page = 1; | |
} | |
// Variables | |
$row = 0; | |
$images_per_page = 12; // How many images to display on each 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 | |
//if a certain page, then display posts authored by the logged in user | |
$page_title = 'Contributors Page'; | |
if ( is_user_logged_in() && is_page($page_title) ) { | |
global $current_user; | |
get_currentuserinfo(); | |
echo 'User ID: ' . $current_user->ID . "\n"; | |
$args=array( | |
'author' => $current_user->ID, | |
'post_type' => 'post', |
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
.section-filtering .filtering-image { | |
overflow: hidden; /* Crops the image */ | |
} | |
.section-filtering .filtering-image img { | |
max-width: 100% !important; /* Overrides max width */ | |
max-height: none !important; /* Overrides max height */ | |
width: 250px; /* Width of image */ | |
} |
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
global $acf; | |
if( !$acf ) | |
{ | |
define( 'ACF_LITE' , true ); | |
include_once('advanced-custom-fields/acf.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
<?php echo apply_filters('the_content', get_post_meta($post->ID, 'your_custom_field_here', 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
add_filter( 'template_include', array($this,'template_chooser')); | |
function template_chooser( $template ) { | |
// Post ID | |
$post_id = get_the_ID(); | |
// For all other CPT | |
if ( get_post_type( $post_id ) != 'projects' ) { | |
return $template; | |
} |
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 acf_translate_fields( $field ){ | |
$field['label' ] = __( $field['label' ], 'plugin-slug' ); | |
$field['instructions' ] = __( $field['instructions' ], 'plugin-slug' ); | |
return $field; | |
} | |
add_filter('acf/load_field', array($this,'acf_translate_fields')); |
NewerOlder