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('get_custom_logo', 'prefix_custom_logo_default', 10); | |
function prefix_custom_logo_default($html){ | |
if(empty($html)){ | |
$html = '<a href="'.esc_url(site_url()).'" class="custom-logo-link" rel="home" itemprop="url">'; | |
$html .= '<img src="'.get_template_directory_uri() .'/images/logo.png" alt="Logo" class="custom-logo" itemprop="logo" />'; | |
$html .= '</a>'; | |
} | |
return $html; | |
} |
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('get_custom_logo', 'prefix_custom_logo_output', 10); | |
function prefix_custom_logo_output( $html ){ | |
$html = str_replace( 'custom-logo-link', 'custom-logo-link navbar-brand', $html ); | |
return $html; | |
} |
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
<div id="fullpage"> | |
<?php | |
$args = array( | |
'sort_column' => 'menu_order' | |
); | |
$pages = get_pages($args); | |
$i = 0; | |
foreach ( $pages as $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
add_filter( 'comment_text', array( $wp_embed, 'run_shortcode' ), 8 ); | |
add_filter( 'comment_text', array( $wp_embed, 'autoembed'), 8 ); |
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 admin_css() { | |
echo '<style> | |
.focus-on #wpcontent { | |
margin-left:0; | |
width:100%; | |
} | |
. .focus-on ##wpbody-content .metabox-holder{ | |
width:100%; | |
} | |
.focus-on #poststuff #post-body.columns-2 { |
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 se_comment_moderation_recipients( $emails, $comment_id ) { | |
$emails = array( 'myemailk@mail.com' ); | |
return $emails; | |
} | |
add_filter( 'comment_moderation_recipients', 'se_comment_moderation_recipients', 11, 2 ); | |
add_filter( 'comment_notification_recipients', 'se_comment_moderation_recipients', 11, 2 ); |
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', 'my_function_name', PHP_INT_MAX, 2 ); | |
function my_function_name( $template ) { | |
if(is_page('about')){ | |
$template = dirname( __FILE__ ) . '/templates/about.php'; | |
} | |
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
$(document).ready(function(){ | |
$('a').each(function() { | |
if( | |
$(this).attr('target') == '_blank' || | |
$(this).attr('rel') == 'noopener' || | |
$(this).attr('rel') == 'noreferrer' ) { | |
$(this).attr('rel', 'noopener noreferrer'); | |
} | |
}); | |
}); |
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
<ul> | |
<?php | |
$query_args = new WP_Query( | |
array( | |
'post_type' => 'attachment', | |
'posts_per_page' => -1, | |
) | |
); | |
if ( $query_args->have_posts() ) { | |
while ( $query_args->have_posts() ) : $query_args->the_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
<?php | |
class WP_Widget_NANE_Recent_Posts extends WP_Widget { | |
public function __construct() { | |
$widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "Your site’s most recent Posts.", "textdomain") ); | |
parent::__construct('recent-posts', __('Recent Posts', 'textdomain'), $widget_ops, 'textdomain'); | |
$this->alt_option_name = 'widget_recent_entries'; | |
add_action( 'save_post', array($this, 'flush_widget_cache') ); | |
add_action( 'deleted_post', array($this, 'flush_widget_cache') ); |
OlderNewer