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 redirect_to_single_post(){ | |
global $wp_query; | |
if((is_archive() || is_category()) && $wp_query->post_count == 1){ | |
// Setup post data | |
the_post(); | |
// Get permalink | |
$post_url = get_permalink(); | |
// Redirect to single post page | |
wp_redirect( $post_url ); | |
} |
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
//decide when you want to apply the auto paragraph | |
add_filter('the_content','my_custom_formatting'); | |
function my_custom_formatting($content){ | |
if(get_post_type()=='my_custom_post') //if it does not work, you may want to pass the current post object to get_post_type | |
return $content;//no autop | |
else | |
return wpautop($content); | |
} |
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
$('.download_resume_trigger').each(function() { | |
$(this).on('click', function (event) { | |
event.preventDefault(); | |
$(this).next()[0].click(); | |
}); | |
}); |
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 | |
$new = new WP_Query('post_type=property'); | |
while ($new->have_posts()) : $new->the_post(); ?> | |
<?php $terms = get_the_terms( $post->ID, 'location' ); ?> | |
<div class="element-item transition <?php foreach( $terms as $term ) echo ' ' . $term->slug; ?>" data-category="transition"> | |
<div class="name"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div> | |
</div> | |
<?php endwhile; ?> |
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
//https://codex.wordpress.org/Post_Status_Transitions | |
//send email to admin after user create new deal from frontend form. | |
add_action('future_to_pending', 'send_emails_on_new_event'); | |
add_action('new_to_pending', 'send_emails_on_new_event'); | |
add_action('draft_to_pending', 'send_emails_on_new_event'); | |
add_action('auto-draft_to_pending', 'send_emails_on_new_event'); | |
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> | |
Percentage sized and still centered. | |
</div> |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>jQuery Variable Height</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="col1"></div> | |
<div id="col2"></div> | |
<div id="sidebar">asdsd <br>asdasd</div> |