Bindiya Patoliya
  • Member for 8 years, 5 months
  • Last seen more than 6 years ago
  • India
7 answers
votes
176k views
When should you use WP_Query vs query_posts() vs get_posts()?
16 votes

Make sure that you use wp_reset_query() after using query_posts() because it will affect other query result also.

View answer
5 answers
vote
7k views
Headers already sent in Pluggable.php / homepage and wp-login error
3 votes

It is usually because there are spaces, new lines, or other stuff before an opening tag, typically in wp-config.php. This could be true about some other file too, so please check the error message, ...

View answer
1 answers
votes
122 views
Different page parameters inside query
2 votes

NO, you cannot combine post_in and post_not_in in the same query. Both are mutually exclusive, So it is impossible for mutually exclusive events to occur at the same time.

View answer
3 answers
votes
39k views
How do I get the current edit page ID in the admin?
2 votes

You can add this code in functions.php file and it will give you a meta box above the publish settings box when editing a post or page. <?php function cf_post_id() { global $post; // Get ...

View answer
3 answers
vote
16k views
Use get_term_children to get the sub category of a parent category for the current post
1 votes

$term_id = get_term_by( 'slug', 'brands', 'product_cat' ); $taxonomy_name = 'product_cat'; $termchildren = get_term_children( $term_id, $taxonomy_name ); echo '<ul>'; foreach ( $...

View answer
1 answers
votes
1k views
Can't reply to comments
1 votes

Try this Solution.This will surely helps you. Replace your wp-includes and wp-admin folder with WordPress's core folder from WordPress package. May be you have problem with uploading these two ...

View answer
1 answers
votes
2k views
Show 10 Sub Categories Per Parent Category Page?
1 votes

Try this way : get_categories('hide_empty=0&number=10&parent='.$cat); For more reference visit this link Here number represents : number (string) The number of categories to return

View answer
1 answers
votes
2k views
How can i add custom field inside custom post taxonomy?
1 votes

There is a plugin for that http://wordpress.org/extend/plugins/taxonomy-metadata/ OR Adding custom meta fields to a taxonomy requires three separate functions: one to add the field to the Add New ...

View answer
3 answers
votes
7k views
Exclude one category from get_the_term_list
1 votes

Try this <?php $terms = get_the_terms( the_ID(), 'project_category' ); if(!empty($terms)) : ?> <?php foreach ( $terms as $term ) { if($term->term_id != 20) { // the ...

View answer
2 answers
vote
2k views
Custom query works but returns "Undefined Offset: 0"
1 votes

Try like this : $args = array( 'post_type' => 'car', 'posts_per_page' => -1, 'tax_query' => array( array( 'taxonomy' => 'your category/taxonomy name for ...

View answer
2 answers
votes
395 views
Most commented post should be the first post in the blog
1 votes

WP Query has a comment_count parameter since 2.9. You can use 'orderby' => 'comment_count' in your query with other parameters, which list by number of comment count of post $args=array( ..........

View answer
1 answers
votes
921 views
Get Custom Post Child Term
1 votes

Try this may be help you. $terms = get_the_terms($post->ID, 'section' ); echo '<ul>'; foreach ($terms as $term) { $term_slugs_arr[0] = $term->name; $...

View answer
2 answers
votes
769 views
Variable not working in WP_Query
1 votes

You have to use array like this: array( 'post_type' =>'news', 'category_name' => $category, //use category slug (NOT name). 'post__not_in'=> array($post->ID) ); ...

View answer
2 answers
votes
910 views
Custom Shortcode and Button not Working after 3.9 update
1 votes

Try like this: <script type="text/javascript"> tinymce.init({ selector: "textarea", toolbar: "mybutton", setup: function(editor) { editor.addButton('mybutton', { ...

View answer
3 answers
votes
6k views
How to query categories with Advanced Custom Fields?
Accepted answer
1 votes

Try something like this : $value = get_field('field_name'); Try whole process based on this http://www.advancedcustomfields.com/resources/how-to/filter-posts-by-custom-fields/ $value = ...

View answer
4 answers
votes
5k views
update_option not working in stand-alone PHP script
1 votes

Add this two line in your file top $parse_uri = explode( 'wp-content', $_SERVER['SCRIPT_FILENAME'] ); require_once( $parse_uri[0] . 'wp-load.php' ); It loads all of WordPress, but doesn't call wp()...

View answer
2 answers
vote
1k views
Wordpress site not working after move
1 votes

You need to login to the database and manually edit 2 entries. In the wp_options table you can find siteurl and home. Update those appropriately, you should then be able to login properly. You also ...

View answer
1 answers
vote
3k views
Secondary Featured Image Function (post_thumbnail)
1 votes

First thing you need to do is install and activate the Multiple Post Thumbnails plugin. After activating the plugin, you need to add the following code in your theme’s functions.php file. You can add ...

View answer
1 answers
votes
246 views
To generate Flickr Gallery in my wordpress site which plugin to use
1 votes

This plugin helps you for you to fulfill your requirements. http://wordpress.org/plugins/awesome-flickr-gallery-plugin/

View answer
3 answers
votes
2k views
Displaying another main nav menu for specific category
Accepted answer
1 votes

Yes,You can do it by if(is_category()) { wp_nav_menu( array( 'theme_location' => 'menu-97226', 'walker' => new Menu_Walker_97226() ) ); } while calling menu in header file.

View answer
3 answers
votes
7k views
Add button in TinyMCE editor to insert text
0 votes

Try this : Add this code to functions.php file. add_action( 'init', 'droid_buttons' ); function droid_buttons() { add_filter( "mce_external_plugins", "droid_add_buttons" ); add_filter( '...

View answer
1 answers
votes
2k views
How do i get value from wp_postmeta?
Accepted answer
0 votes

Try this : $value = get_post_custom_values( 'banda_postmeta', $post->ID ); $value = unserialize("$value"); print_r($value); echo $value['social_networks_url']['twitter_url']; Your ...

View answer
2 answers
votes
3k views
Querying with WP query using meta key price
Accepted answer
0 votes

'meta_value_num' - Order by numeric meta value (available with Version 2.8). Also note that a 'meta_key=keyname' must also be present in the query. This value allows for numerical sorting as noted ...

View answer
4 answers
vote
7k views
How I upload, save and set a featured image from my frontend?
0 votes

You can try this way : set_post_thumbnail( $my_post_id, $thumbnail_id ); You have to add image into library first like this way : $uploaddir = wp_upload_dir(); $file = $_FILES[ ... whatever you ...

View answer
2 answers
votes
441 views
Codex Function Problems When There is an Apostrophe in the Category Name
0 votes

You can use this. May it will help you. ent2ncr Converts named entities into numbered entities.

View answer
1 answers
votes
242 views
Bootsrtap.css overlap style.css in custom wordpress theme
Accepted answer
0 votes

You can load first bootstrap.min.css and then after your main style.css and Set About Us as About, then your issue is solved.

View answer
1 answers
votes
112 views
Categories in media library
0 votes

Yes, You can do this functionality by this plugins : wp-media-library-categories media-category-library

View answer
2 answers
vote
545 views
Querying Custom Post Type, ordering by Custom Taxonomy Pagination Not Working
0 votes

You have to use $paged variable like this : <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $posts = get_posts(array( 'post_type' => 'product', 'taxonomy' ...

View answer
3 answers
votes
16k views
Parse error: syntax error, unexpected end of file
0 votes

Here is the reference Doc for Loop in WordPress, from that if you want to use : then no need to use {}. you can use one of them at same time.

View answer
3 answers
votes
3k views
Define size for `get_post_gallery_images`, they seem to have been resized to 150x150
0 votes

If you're working within a template file, this code should work. <?php echo do_shortcode('[gallery size="full"]'); ?>

View answer