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
/%category%/%postname%/ |
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 | |
//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin) | |
$taxonomy = 'genre'; | |
$orderby = 'name'; | |
$show_count = 0; // 1 for yes, 0 for no | |
$pad_counts = 0; // 1 for yes, 0 for no | |
$hierarchical = 1; // 1 for yes, 0 for no | |
$title = ''; |
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( 'img_caption_shortcode', 'dap_responsive_img_caption_filter', 10, 3 ); | |
function dap_responsive_img_caption_filter( $val, $attr, $content = null ) { | |
extract(shortcode_atts( array( | |
'id' => '', | |
'align' => '', | |
'width' => '', | |
'caption' => '' | |
), | |
$attr)); |
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 filter_ptags_on_images($content){ | |
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); | |
} | |
add_filter('the_content', 'filter_ptags_on_images'); |
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 (has_post_thumbnail( $post->ID ) ): ?> | |
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?> | |
<div id="custom-bg" style="background-image: url('<?php echo $image[0]; ?>')"> | |
</div> | |
<?php endif; ?> |
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 the post has a Post Thumbnail assigned to it. | |
if ( has_post_thumbnail() ) { | |
the_post_thumbnail('thumbnail'); | |
} | |
?> |
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 // loop for taxonomy in custom post-type | |
$argsMine = array( | |
'numberposts' => -1, | |
'orderby' => 'desc', | |
'post_type' => 'info', | |
'section' => 'minesweeper', | |
'post_status' => 'publish' | |
); | |
$postslist = get_posts($argsMine); | |
foreach ($postslist as $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 | |
//list terms in a given taxonomy | |
$taxonomy = 'news-category'; | |
$tax_terms = get_terms($taxonomy); | |
?> | |
<ul class="categories"> | |
<?php | |
foreach ($tax_terms as $tax_term) { | |
echo '<li><h3>' . '<a href="' . esc_attr(get_term_link($tax_term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . '" ' . '>' . $tax_term->name.'</a><h3></li>'; | |
} |
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
/* =WordPress Core | |
-------------------------------------------------------------- */ | |
.alignnone { | |
margin: 5px 20px 20px 0; | |
} | |
.aligncenter, | |
div.aligncenter { | |
display: block; | |
margin: 5px auto 5px auto; |
NewerOlder