This file contains hidden or 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 'last' class to last post | |
* Must be using <?php post_class(); ?> | |
*/ | |
function add_last_class($classes) { | |
global $wp_query; | |
if(($wp_query->current_post + 1) == $wp_query->post_count) | |
$classes[] = 'last'; |
This file contains hidden or 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
jQuery(document).ready(function($){ | |
$('.meta-color').wpColorPicker(); | |
}); |
This file contains hidden or 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 | |
// Creating the widget | |
class name_prefix_widget extends WP_Widget { | |
function __construct() { | |
parent::__construct( | |
// Base ID of your widget | |
'name_prefix_widget', | |
// Widget name will appear in UI | |
__('Recent Posts with Image', 'text-domain'), |
This file contains hidden or 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 | |
$tags = get_the_tags(); | |
$html = '<div class="post_tags">'; | |
foreach ($tags as $tag){ | |
$tag_link = get_tag_link($tag->term_id); | |
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>"; | |
$html .= "{$tag->name}</a>"; | |
} | |
$html .= '</div>'; |
This file contains hidden or 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
/** | |
* Custom Read More Button | |
*/ | |
function modify_read_more_link() { | |
return '<br><a class="custom-more" href="' . get_permalink() . '">'. __( 'Read More', 'textdomain' ). '></a>'; | |
} | |
add_filter( 'the_content_more_link', 'modify_read_more_link' ); |
This file contains hidden or 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
zip -r bar.zip bar -x "*.DS_Store" |
This file contains hidden or 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
<script> | |
console.log(<?php echo json_encode($_POST); ?>); | |
</script> |
This file contains hidden or 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
jQuery(document).ready(function($){ | |
}); |
This file contains hidden or 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 | |
function prefix_customizer_register( $wp_customize ) { | |
$wp_customize->add_panel( 'panel_id', array( | |
'priority' => 10, | |
'capability' => 'edit_theme_options', | |
'theme_supports' => '', | |
'title' => __( 'Example Panel', 'textdomain' ), | |
'description' => __( 'Description of what this panel does.', 'textdomain' ), |
OlderNewer