Get Posts ordered by a date custom meta field
Try to change ‘orderby’ => ‘meta_value’,’meta_key’ => ‘event-date-start’
Try to change ‘orderby’ => ‘meta_value’,’meta_key’ => ‘event-date-start’
Change $myposts = get_posts( ‘numberposts=6&offset=$debut’) to $myposts = get_posts( ‘numberposts=6&category_name=home-slider&offset=$debut’) OR $myposts = get_posts( ‘numberposts=6&category=1&offset=$debut’) replace 1 with your category ID Hope this helps
This was the solution: <?php /** * @package WordPress * @subpackage U-Design */ if (!defined(‘ABSPATH’)) exit; // Exit if accessed directly get_header(); include(‘scripts/search_excerpt/ylsy_search_excerpt.php’); $search = $_GET[‘s’]; $all_users = new WP_User_Query( array( ‘role’ => ‘dc_vendor’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘_vendor_country’, ‘value’ => $search, ‘compare’ => ‘=’ ), ) ) ); //echo … Read more
As @Pieter Goosen said, you shouldn’t be using query_posts, nor running your own query. Instead, override the main query that already runs: function wpse_144974_pre_get_posts( $wp_query ) { if ( ! is_admin() && $wp_query->is_main_query() && is_home() ) $wp_query->set( ‘cat’, 1 ); } add_action( ‘pre_get_posts’, ‘wpse_144974_pre_get_posts’ );
I tried to google “wordpress sql to get post url” and I was pretty astonished I couldn’t find any resource sharing the SQL code to join the wp_post table with the table containing the permalink. That is because there is no table containing the permalink. Your “challenge” and your “astonishment” are because you’ve imagined the … Read more
Use the nav_menu_css_class() filter. The following function will add the current-menu-item class to a page identified by it’s slug. You can Update the $cpt_name and $menu_item_id variables to reflect your setup. add_filter( ‘nav_menu_css_class’, ‘nav_parent_class’, 10, 2 ); function nav_parent_class( $classes, $item ) { $cpt_name=”team”; $menu_item_id = 127; // id of menu item to add current-menu-item … Read more
You’ll probably want filter out some parameters, change the order they’re displayed, etc – but this should get you started: $s = “/?s=Search&property_city=las-vegas&property_location=Nevada&min_price=20000&max_price=500000&beds=2&baths=3&min_area=1000&max_area=1000000&property_type=apartment&s=Search&apor=Any&apvr=Any&post_type=property”; parse_str($s,$parts); foreach ($parts as $key => $value) { $name = ucwords(str_replace(“_”,” “,$key)); echo “$name: $value<br />\n”; } You can probably just use foreach ($_REQUEST as $key => $value) { unless there’s a … Read more
Goto your wordpress phpmyadmin open database 1.All Woocommerce orders save in table-prefix_posts table 2.and Woocommerce order’s meta info like :billing-addres,customer-name store in table-prefix_postmeta table run SQL command in phpmyadmin SELECT * FROM `table-prefix_postmeta` WHERE `post_id` = any order-id LIMIT 0 , 30 you get list of product meta info. _order_items this meta-key store all product … Read more
Try refreshing your permalinks. That is, simply visit your settings -> permalinks page. Then check single-listing.php again. WordPress may need nudging to pay attention to your new file.
Did you try to change the PHP version from 5.6 to 7.x? It can help to improve page load speed. If you use CPanel you can change it below on “MultiPHP Manager” menu. If you use cache plugins try to disable them. Some kind of plugins can decrease the load speed. If it doesn’t help … Read more