change posts_orderby of the callback wp_query?

I found this answer that helps with ordering query results by the post type in my search query. But the issue is that it helps when I go to https://example.com/?s=query%20string that is if I search using native php search. And that’s great. But I also have the search via ajax – when I type, the ajax will call my callback function that is registered on a custom rest endpoint. So I am wondering if there is any way that I can identify that custom query so that I can reuse…

Web Design Weekly #297

Headlines Sketching Interfaces A few times a year something really blows my mind in the web development space and this is one of them. High fives to the Airbnb team for pushing things forward. (airbnb.design) The React Story (stackshare.io) Articles Real-world Web Performance Budgets If you happen to work on a product that is getting big and bigger by the day and performance is becoming an issue, read this. Oh and send it to your manager. (infrequently.org) My approach to using z-index Another entertaining post by David Gilbertson that will…

Woocommerce pagination not working in custom loop WP_Query

Please help with pagination I have code that works fine (functions.php) function projects_custom_number_of_posts( $query ) { $query->set( ‘posts_per_page’, 2 ); return; } add_action( ‘pre_get_posts’, ‘projects_custom_number_of_posts’); when I change to, pagination stops working function projects_custom_number_of_posts( $query ) { $postsperpage = $query->get( ‘posts_per_page’ ); $query->set( ‘posts_per_page’, $postsperpage ); return; } add_action( ‘pre_get_posts’, ‘projects_custom_number_of_posts’); It is necessary that the data is taken from the ‘posts_per_page’ $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array(‘product_cat’ => $cat, ‘post_type’ => ‘product’, ‘posts_per_page’ => 2, ‘paged’ => $paged ); $query = new WP_Query( $args );…

Web Design Weekly #296

Headlines The 6-Step “Happy Path” to HTTPS Troy Hunt explains the fastest and easiest way you can get HTTPS up and running correctly. (troyhunt.com) Documenting the Web together (blogs.windows.com) The new tab page you’ll actually use Replace your web browser’s gratuitous new tab page with a clean and simple list of links, grouped and sorted how you like. Available for web, and as a Chrome extension. A Fine Start — a concise new tab page. Get it for free here » (afinestart.me) Articles Prettier + Stylelint If you are keen…

How to move comments form above comments list in wordpress

Please help me modify code to move Comments form above comments list in a WordPress blow. Below is the code of comments.php page <?php /** * The template for displaying Comments. */ ?> <?php /* * If the current post is protected by a password and * the visitor has not yet entered the password we will * return early without loading the comments. */ if (post_password_required()) return; ?> <?php if ( comments_open() ) : ?> <div id= »comments » class= »comments-area clear-fix »> <?php if (have_comments()):?> <div class= »comments-area-title »> <h3> <?php printf( _n(‘1 comment’,…

How to properly setup MAMP and XIP

I have a local WordPress install running through MAMP. It’s local domain is example.dev I also have the install working with xip.io. It’s at example.dev.0.0.0.0.xip.io (0’s being my ip address). Right now the only way I seem to be able to get xip.io working is to add define(‘WP_HOME’, ‘http://example.dev.0.0.0.0.xip.io’); define(‘WP_SITEURL’, ‘http://example.dev.0.0.0.0.xip.io’); to my wp-config.php file. This forces anyone going to example.dev to go to example.dev.0.0.0.0.xip.io The issue is at the office, my computer has a static IP address. At home, it does not. So if I am in the office…

Web Design Weekly #295

Headlines Is this my interface or yours? John Saito shares some thoughts around interface items that belong to you. A great piece that sure does get you thinking. (medium.com) Rebuilding Slacks Website (slack.engineering) Manage projects. Bill your clients. Stay profitable. Meet Harpoon, the all-in-one financial success platform for freelancers, studios, and agencies. You decide how much money you want your business to make this year. Harpoon provides the tools you need to help achieve that goal. Try it free for 14 days! (harpoonapp.com) Articles The whole web at maximum FPS…

WordPress Multisite Network Subdomain

I want to start something, but before i do it i’m asking for some advice. the scenario is….. mywebsite.com i will have listing directories and i want for every category to use a different theme, like automobile/mywebsite.com automobile theme food/mywebsite.com food theme education/mywebsite.com education theme other/mywebsite.com some other theme is it possible that, when « user1 » comes to « automobile/mywebsite.com » makes new registration and in the same time is registered to all subdomains. so when « user1 » comes to « food/mywebsite.com » is already registered or to any other subdomain. is something like this possible…

Tortoise SVN showing ‘Access to ‘/!svn/me » forbidden error.

I recently want to commit a change to my WordPress plugin repo but it has been showing ‘Access to ‘/!svn/me’ forbidden’ error whenever I wanted to commit any changes. Some articles have adviced me to check if my username and password are correct but it seems not to be the right solution because my login credentials are actually correct. Please, has anyone faced this issue before or is there an alternative to TortoiseSVN that I can use? Thank you! Source: https://wordpress.stackexchange.com/feeds