rameshwor.maharjan
Forum Replies Created
-
Yes reverting back to older version works well.
Cocart version is attached
The response from the end point is empty array when filtering by category slug.
We are using WordPress version: 6.5.3
PHP 7.4Is there anything else you want me to share, thanks
Forum: Themes and Templates
In reply to: Where to change the_content( ) ?Hi,
you need to hook your own function to modify the output of the_content. see the code below for example.
add_filter( 'the_content', 'your_the_content' ); function your_the_content( $content ) { return $content . "<br/>" . "add your text here"; }
I hope this will help!!
Forum: Fixing WordPress
In reply to: Order custom post type by date fieldsee the code below
<?php $the_query = new WP_Query( array( 'post_type' => 'match', 'order' => 'ASC', 'orderby' => 'meta_value', 'meta_key' => 'when' ) ); $current_header = ''; while ( $the_query->have_posts() ) : $the_query->the_post(); # get the datum for this post $temp_date = get_post_meta( get_the_ID(), 'when', true ); # If they aren't the same, we'll start a new group, which for now # just means setting a new heading if ( $temp_date != $current_header ) { $current_header = $temp_date; echo "<h2>$current_header</h2>"; } the_title(); # ... do normal loop stuff here endwhile; wp_reset_query(); ?>
Forum: Fixing WordPress
In reply to: Order custom post type by date fieldNote: instead of saving dates in date format save it as string like in above tutorial. After that this should work;
query_posts( array(
‘post_type’ => ‘match’,
‘order’ => ‘ASC’,
‘orderby’ => ‘meta_value’,
‘meta_key’ => ‘when’
) );Forum: Fixing WordPress
In reply to: Order custom post type by date fieldhttps://designhammer.com/blog/sorting-events-date-using-wordpress-custom-post-types
this is what you need.
Forum: Fixing WordPress
In reply to: Order custom post type by date fieldIf its front end this should work
query_posts( array( 'post_type' => 'match', 'order' => 'ASC', 'orderby' => 'meta_value', 'meta_key' => 'date-field' ) ); while ( have_posts() ) : the_post(); echo ' <li>'; the_title(); echo '</li> '; endwhile;
Also in your code I don’t see any date fields in meta box
Forum: Fixing WordPress
In reply to: Order custom post type by date fieldis this for backend post listing or front end?
Forum: Fixing WordPress
In reply to: Order custom post type by date fieldyou need to order by meta_value. see below
query_posts( array(
‘post_type’ => ‘services’,
‘order’ => ‘ASC’,
‘orderby’ => ‘meta_value’,
‘meta_key’ => ‘date-field’
) );Forum: Networking WordPress
In reply to: problem with permalink (redirect to main domain)