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> | |
// Check if current WP page is parent | |
$isParent = get_pages(array( | |
'child_of' => get_the_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
// scroll to in page linked sections | |
$('a[href*="#"]:not([href="#"])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html, body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
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
//ACF image using image ID and ACF field for image alt attribute | |
$img = wp_get_attachment_image_src(get_field('image'), 'img-size'); | |
$img_alt = esc_attr(get_field('image_alt')); | |
$imgsrc = $img[0]; | |
$imgwidth = $img[1]; | |
$imgheight = $img[2]; | |
$sizes_value = wp_get_attachment_image_sizes( get_field('image'), 'img-size' ); | |
$sizes = $sizes_value ? ' sizes="' . esc_attr( $sizes_value ) . '"' : ''; |
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
// Remove the content editor from Wordpress | |
add_action( 'init', 'my_custom_init' ); | |
function my_custom_init() { | |
// removes the content editor for Pages | |
remove_post_type_support( 'page', 'editor' ); | |
// removes the content editor ofr all Posts | |
remove_post_type_support( 'post', 'editor' ); | |
} |
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 action_edit_form_before_permalink($return){ | |
return "<div class='url-description'>Make sure you use a really good url!!!!</div>" . $return; | |
} | |
add_filter( 'get_sample_permalink_html', 'action_edit_form_before_permalink' ); |
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 ChangeTheTitlePlaceholder(){ | |
return 'Put Your Awesome Title Here!'; | |
} | |
add_filter( 'enter_title_here', 'ChangeTheTitlePlaceholder' ); |
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 text to the Featured Image Box | |
function ChangeFeaturedImageText( $content ) { | |
$img_size_text = "Size ratio: 400 x 300"; | |
return $content . $img_size_text; | |
} | |
add_filter( 'admin_post_thumbnail_html', 'ChangeFeaturedImageText' ); |