12
Jan

$myquery['tax_query'] = array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘category’, ‘terms’ => array(‘cat1′), ‘field’ => ‘slug’, ), array( ‘taxonomy’ => ‘post_tag’, ‘terms’ => array(‘tag1′), ‘field’ => ‘slug’, ), ); query_posts($myquery);

$myquery['tax_query'] = array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array(‘cat1′, ‘cat2′), ‘field’ => ‘slug’, ‘operator’ => ‘NOT IN’, ), ); query_posts($myquery);

11
Jan

$myquery['tax_query'] = array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array(‘category1′), ‘field’ => ‘slug’, ), array( ‘taxonomy’ => ‘post_tag’, ‘terms’ => array(‘tag1′), ‘field’ => ‘slug’, ), ); query_posts($myquery);

function myfeed_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type'])) $qv['post_type'] = array(‘post’, ‘banner’); return $qv; } add_filter(‘request’, ‘myfeed_request’);

function add_count() { if (!post_type_exists($this->type)) { return; } $num_posts = wp_count_posts( $this->type ); $num = number_format_i18n( $num_posts->publish ); $text = _n( $this->single, $this->plural, intval($num_posts->publish) ); if ( current_user_can( ‘edit_posts’ ) ) { $num = “<a href=’edit.php?post_type=” . $this->type . “‘>$num</a>”; $text = “<a href=’edit.php?post_type=” . $this->type . “‘>$text</a>”; } echo ‘<td>’ . $num . ‘</td>’; [...]

<files wp-config.php> order allow,deny deny from all </files>

03
Nov

add_filter( ‘admin_footer_text’, ‘my_admin_footer_text’ ); function my_admin_footer_text( $default_text ) { return ‘<span id=”footer-thankyou”>Website redeveloped by <a href=”http://www.webexperts4u.com” target=”_blank”>WebExperts</a><span> | Powered by <a href=”http://www.wordpress.org” target=”_blank”>WordPress</a>’; }

function myfeed_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type'])) $qv['post_type'] = array(‘post’, ‘banner’); return $qv; } add_filter(‘request’, ‘myfeed_request’);

// hook the translation filters add_filter(  ’gettext’,  ’change_post_to_article’  ); add_filter(  ’ngettext’,  ’change_post_to_article’  );function change_post_to_article( $translated ) { $translated = str_ireplace(  ’Post’,  ’Article’,  $translated );  // ireplace is PHP5 only return $translated; }

12
Oct
stored in: Wordpress and tagged:

add_action( ‘init’, ‘my_add_excerpts_to_pages’ ); function my_add_excerpts_to_pages() { add_post_type_support( ‘page’, ‘excerpt’ ); }