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 this to your theme functions.php file --> | |
/* | |
* Enable support for Post Thumbnails on posts and pages. | |
* | |
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/ | |
*/ | |
add_theme_support( 'post-thumbnails' ); | |
// This theme uses a custom image size for featured images, displayed on "standard" posts. | |
if ( function_exists( 'add_theme_support' ) ) { |
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 Shortcode | |
function foundation_tooltip( $atts ) { | |
// Attributes | |
$atts = shortcode_atts( | |
array( | |
'content' => 'Default Content', | |
'title' => 'Default title', | |
), | |
$atts, | |
'tooltip' |
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 the post does NOT have a [gallery], show the featured image | |
if ( strpos( $post->post_content,'[gallery' ) === false ) { | |
$gallery = 0; | |
if ( has_post_thumbnail() && 'gallery' != get_post_format() ) { | |
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' ); | |
if ( ! empty( $large_image_url[0] ) ) { | |
echo '<a rel="lightbox" href="' . esc_url( $large_image_url[0] ) . '" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">'; | |
echo get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'class' => 'float-right thumbnail' ) ); | |
echo '</a>'; |
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 | |
// Remove un-needed fields from the user profile page in /admin | |
function remove_extra_field_profile() { | |
$current_file_url = preg_replace( '#\?.*#' , '' , basename( $_SERVER['REQUEST_URI'] ) ); | |
if ( $current_file_url == 'profile.php' ) { | |
add_action( 'wp_loaded', function(){ ob_start( 'profile_callback' ); | |
} ); | |
add_action( 'shutdown', function(){ ob_end_flush(); |
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
// Change Admin Menu For Blog Posts | |
function macg_change_post_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'Blogs'; | |
$submenu['edit.php'][5][0] = 'Blogs'; | |
$submenu['edit.php'][10][0] = 'Add Blogs'; | |
$submenu['edit.php'][16][0] = 'Blogs Tags'; | |
} | |
function macg_change_post_object() { |
NewerOlder