Unanswered Questions
1,830 questions with no upvoted or accepted answers
2
votes
0
answers
740
views
WooCommerce - How to show specific category first-rest of products-specific category last
This is the case:
A product has 2 categories: "New products" and "Shirts"
Another product has 2 categories: "Shirts" and "Outlet"
What I need is to show in a paginated loop the products with the ...
2
votes
1
answer
172
views
How can I reuse the Wordpress search form for a custom plugin / widget?
I need to develop a custom widget to display posts, based on their ID.
The user must be able to handpick posts. Right now, they can enter the post ID, but it is not convenient for them.
Is it ...
2
votes
0
answers
959
views
Passing jQuery value using Ajax to a page template
I have the following jQuery code:-
jQuery('.fancymember').on('click', function() {
var member = jQuery(this).parent('div').parent('div').find('.test').val();
var dataString = 'member='+ ...
2
votes
1
answer
641
views
Double count view in archive.php
I'm having a hard time using this snippet I'm getting double views each time the post is queried.
This is in my functions.php file:
function getPostViews($postID){
$count_key = 'post_views_count';...
2
votes
1
answer
256
views
Lists Posts from CPT that match the Title of the Page
I am trying to get all the posts associated with the Title of a page.
This is what I currently have:
<?php
$title_to_tag_posts_query = new WP_Query( array(
'tag' => ...
2
votes
0
answers
1k
views
Custom Loop through category menu to include sub categories
In my custom wordpress theme I currently have the below loop to the main categories
<?php
$menu = wp_get_nav_menu_object('navigation');
$items = wp_get_nav_menu_items($menu->term_id);
foreach($...
2
votes
0
answers
2k
views
AJAX image upload with a upload progress bar using media_handle_upload
I currently have post image upload for the featured image from front-end form.
<input type="file" name="wh_image_upload" id="wh_image_upload" multiple="false" />
and using media_handle_upload ...
2
votes
0
answers
2k
views
'Lazy loading' list of posts with pagination
I have reading settings set to show 30 posts per page, and what I'd like to do is show half of the list of posts and then 'lazy load' the remaining half on scroll. I've checked out some the available ...
2
votes
0
answers
507
views
Admin wp_ajax hook returning 0
I've done some research but I can't seem to find the correct answer so I'm hoping someone can give me a hand. I'm attempting to use the wp_ajax hook in the admin section. The functionality should be ...
2
votes
0
answers
69
views
Show top level comments ordered by number of replies
I am trying to modify the comment loop initiated by wp_list_comments to change the order they are returned.
Specifically I have 2 levels enabled on my comments (top level and replies), and I want to ...
2
votes
1
answer
287
views
Is it safe to use $_POST directly in my plugin instead of using admin-ajax.php to receive data from ajax?
When we want post data from frontend to WORDPRESS everyone says i must use admin-ajax.php.
But i can add query vars and receive posted data in my plugin file using a global variable, and then i can do ...
2
votes
0
answers
1k
views
WP_Query Order by Specific Post ID First
I'm creating a website where I have a need to show a set of posts from a custom loop but I need to display a specific post first.
This post will be dynamically specified in the URI by a $_GET ...
2
votes
1
answer
1k
views
Is it possible to hook AJAX to UPDATE-button?
I have a site with a custom post. When I enter that custom post in admin (edit)-page then a form is rendered. This form takes like about 2-3s to render - it's a lot of of values in it - both hidden ...
2
votes
0
answers
222
views
Divide Loop Into Days & Categories
If you could help, I'd greatly appreciate it, because I'm halfway there, but I'm currently stuck!
The site I'm working on needs to have it's posts, within the loop, divided up by days, and then under ...
2
votes
0
answers
3k
views
How to set a custom path, for ajax image upload folder in admin?
I am coding my first Wordpress plugin that handles some data for a custom (shop-like) post type. It also has an image uploader within a metabox, where you simply drag in your images and it ...