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
| //in function.php | |
| function filter_orderby_sticky( $order = '' ) { | |
| global $wpdb; | |
| //$first = pods('pods settings'); | |
| //$first = (int)$first->field( 'name of field' ); // if pods | |
| return '('.$wpdb->prefix.'posts.ID = '.$first.') DESC, '.$wpdb->prefix.'posts.post_date DESC'; // $first is id of first post | |
| } | |
| // custom wp_query | |
| add_filter( 'posts_orderby', 'filter_orderby_sticky' ); |
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
| function parse_youtube_url($url) { | |
| $pattern = '#^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=|/watch\?.+&v=))([\w-]{11})(?:.+)?$#x'; | |
| preg_match($pattern, $url, $matches); | |
| return (isset($matches[1])) ? $matches[1] : false; | |
| } |
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
| global $query_string; | |
| query_posts( $query_string . '&posts_per_page=999&orderby=title&order=DESC' ); | |
| //if (have_posts()) : while (have_posts()) : the_post(); blablabla//// |
NewerOlder