shafraz
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Exclude Custom Post Types from Search Query ResultsOr if any one wants to just search through selected post types simply add the function to function.php
*note: ‘video-camera’, ‘software-solution’,’post’ are the post types which you want to search replace with you own.
// search filter function fb_search_filter($query) { if ( !$query->is_admin && $query->is_search) { $query->set('post_type', array('video-camera', 'software-solution','post') ); // id of page or post } return $query; } add_filter( 'pre_get_posts', 'fb_search_filter' );
it is because the path to the png image is not working in this plugin.
even though the image is not displaying there is a tickbox.you can make it display if you change the directory in yafpp.php file
just change this
.yafpp_on, .yafpp_off { background: url('https://Path to the png file/wp-content/plugins/yet-another-featured-posts-plugin/img/stars.png') no-repeat 0 0; width: 16px; height: 16px; cursor: pointer; }
yes YAFPP have that prob but still you can use this plugin.
add this code
'post_type' => array( 'page', 'post', 'customposttype' ),
right below this'post__in' => $featured_arr, 'posts_per_page' => $yafpp_opts['max_posts'],
you can leave page and removepost and customposttype if you want it to use only in pages.
Forum: Fixing WordPress
In reply to: Custom Post Type Taxonomy DisplayAnd if you want to show custom post types also past this code also with the previous one in you function.php
add_action( 'right_now_content_table_end' , 'ucc_right_now_content_table_end2' ); function ucc_right_now_content_table_end2() { $args = array( 'public' => true , '_builtin' => false ); $output = 'object'; $operator = 'and'; $post_types = get_post_types( $args , $output , $operator ); foreach( $post_types as $post_type ) { $num_posts = wp_count_posts( $post_type->name ); $num = number_format_i18n( $num_posts->publish ); $text = _n( $post_type->labels->singular_name, $post_type->labels->name , intval( $num_posts->publish ) ); if ( current_user_can( 'edit_posts' ) ) { $num = "<a href='edit.php?post_type=$post_type->name'>$num</a>"; $text = "<a href='edit.php?post_type=$post_type->name'>$text</a>"; } echo '<tr><td class="first b b-' . $post_type->name . '">' . $num . '</td>'; echo '<td class="t ' . $post_type->name . '">' . $text . '</td></tr>'; } }
Forum: Fixing WordPress
In reply to: Custom Post Type Taxonomy Displayhi ssjaime.
try this code its workin for me no problems at all.add_action( 'right_now_content_table_end' , 'ucc_right_now_content_table_end' ); function ucc_right_now_content_table_end() { $args = array( 'public' => true , '_builtin' => false ); $output = 'object'; $operator = 'and'; $tag_types = get_taxonomies( $args , $output , $operator ); foreach( $tag_types as $tag_type ) { $terms = get_terms($tag_type->name); $num = count($terms); // $num_posts = wp_count_posts( $tag_type->name ); // $num = number_format_i18n( $num_posts->publish ); $text = _n( $tag_type->labels->singular_name, $tag_type->labels->name , intval( $num_posts->publish ) ); if ( current_user_can( 'edit_posts' ) ) { $num = "<a href='edit-tags.php?taxonomy=$tag_type->name'>$num</a>"; $text = "<a href='edit-tags.php?taxonomy=$tag_type->name'>$text</a>"; } echo '<tr><td class="first b b-' . $tag_type->name . '">' . $num . '</td>'; echo '<td class="t ' . $tag_type->name . '">' . $text . '</td></tr>'; } }
Use
ciii_category_images()
insted ofciii_category_archive_image();
its workin for me.