- 0 like
- 0 comment
Dhananjay Kumar |30 Nov at 08:11
Dhananjay Kumar |15 Nov at 06:11
Dhananjay Kumar |23 Jan at 10:01
ACF Filed for taxnomy data not get by function :
get_field("taxnomy_name");
get_field("taxnomy_name",term_id);
get_field("taxnomy_name",post_id);
Dhananjay Kumar |05 Jun at 12:06
Hello,
I have set up wp mail setup plugina and set gmail SMTP and test mail going correctly.
But contact form with sent mail getting below error
"There was an error trying to send your message. Please try again later."
Dhananjay Kumar |03 Jun at 01:06
How to get filter by ACF field in wordpress,
i need to show the post data by filtering or searching by used ACF fileds.
Dhananjay Kumar |03 Jun at 08:06
I want to get page id or post all information by SLUG in wordpress.
Dhananjay Kumar |23 May at 01:05
We have created custom post type by function.php and changing URL by category alais before the name by below code
function custom_post_link( $post_link, $id = 0 ){
$post = get_post($id);
if ( is_object( $post )){
$terms = wp_get_object_terms( $post->ID, 'custom_category' );
if( $terms ){
return str_replace( '%custom_category%' , $terms[0]->slug , $post_link );
}
}
return $post_link;
}
add_filter( 'post_type_link', 'custom_post_link', 1, 3 );
after using this script pages redirection error with multiple "301 redirection on page issues".
Suggest, if any have solution about this.
Dhananjay Kumar |22 May at 12:05
I need to change URL in my post content , suggest query to quick replace all.
Dhananjay Kumar |08 May at 08:05
Hello Friends,
I have issues, in wordpress page on AMP i want to all without AMP url convert in to AMP URL.
Any php script or fuction suggest.
Thanks in advance.
Dhananjay Kumar |18 Apr at 01:04
Hello,
I have added start and end date in post type using advance custome fileds.
and want to view post list as per start & end date like current events, past events and upcoming events..
I have do with below script :
if($_REQUEST['status']=="current"){
$today = date('Ymd');
$artposts = get_posts( array(
'posts_per_page' => 30,
'post_type' => 'exhibitions',
'meta_query' => array('relation' => 'OR',
array('name'=> 'the_beginning_of_the_exhibition',
'value'=> $today,
'type' => 'DATE',
'compare' => '<='),
array('name'=> 'end_of_the_exhibition',
'value'=> $today,
'type' => 'DATE',
'compare' => '>=')
),
'sort_order' => 'desc'
) );
}else if($_REQUEST['status']=="past"){
$artposts = get_posts( array(
'posts_per_page' => 30,
'post_type' => 'exhibitions',
'meta_query' => array(
array('name'=> 'end_of_the_exhibition',
'value'=> date('Ymd'),
'type' => 'DATE',
'compare' => '<')
),
'sort_order' => 'desc'
) );
}else if($_REQUEST['status']=="upcoming"){
$artposts = get_posts( array(
'posts_per_page' => 30,
'post_type' => 'exhibitions',
'meta_query' => array(
array('name'=> 'the_beginning_of_the_exhibition',
'value'=> date('Ymd'),
'type' => 'DATE',
'compare' => '>')
),
'sort_order' => 'desc'
) );
}
Getting proper result with past and upcoming, but issues seems with current, any one have solution please suggest.
Dhananjay Kumar |16 Apr at 08:04
Hello,
I have problem with ACF repeter, not able to retrive value in front end with below script :
if( have_rows('Location_repeter') ):
while ( have_rows('Location_repeter') ) : the_row();
the_sub_field('location_name');
endwhile;
endif;
Is any solution for thats?
Dhananjay Kumar |03 Oct at 12:10
Use the below script:
remove_action('wp_head', 'rel_canonical');
Dhananjay Kumar |03 Oct at 10:10
Hi All,
I have sloved the problem with below script:
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => '_wp_page_template',
'value' => 'page-template.php'
)
)
);
$the_pages = new WP_Query( $args );
$arraypage=array();
$arraypagestitle=array();
if( $the_pages->have_posts() ){
while( $the_pages->have_posts() ){
$the_pages->the_post();
$arraypage[]=array("slug"=>get_permalink(), "title"=>get_the_title());
}
}
wp_reset_postdata();
Dhananjay Kumar |26 Jul at 11:07
I want to create a custom search for a woocommerce product with woocommerce fields and advanced custom fields.
Like price range of woocommerce fields and other fields type using advance custom fields (ACF).
Dhananjay Kumar26 Jul at 12:07
I got the solution, with below script:
We have work on product-arcive.php
------------------------------------------------------------------------------------------------------
$args['post_type'] = 'product';
$taxquery=array();
if(count($_REQUEST)>0){
foreach($_REQUEST as $key=>$val){
if($key=="min_price" && $val!=""){
$passarg[]=array('key'=> '_price',
'value' => $val,
'compare' => '>=',
'type' => 'NUMERIC'
);
}
if($key=="max_price" && $val!=""){
$passarg[]=array('key'=> '_price',
'value' => $val,
'compare' => '<=',
'type' => 'NUMERIC'
);
}
if($key=="acf_field"){
$passarg[]=array('key'=> $key,
'value' => $val,
'compare' => '=',
);
}
}
}
$args['meta_query'] = $passarg;
query_posts( $args );
$the_query = new WP_Query( $args );
------------------------------------------------------------------------------------------------------
Singh Atendra |24 May at 01:05
My project's requirement is to integrate codeigniter and wordpress. Codeigniter files are in root directory of wordpress. Everything is working fine in wordpress but when i access the codeigniter pages it redirect me on wordpress's page not found page. My site is running on LEMP server. i searched regarding it on google , there were some solutions so i tried them but nothing worked in my case. Please help. I thank you in advance.
Dhananjay Kumar26 May at 11:05
I was getting the same issues with LEMP server cause there, not .htaccess file working.
Due to this reason Codeigniter files path "https://abc.com/xyz/" is followed WordPress URL.
I have done the following below script in /etc/nginx/sites-enabled/default file:
location /xyz {
try_files $uri $uri/ /xyz/index.php?$args;
}
location /test {
try_files $uri $uri/ /test/index.php?$args;
}
Added above multiple "location" path which using in CodeIgniter. And its working fine for me.
Please once try above, hope you getting the solution.
Dhananjay Kumar |28 Apr at 07:04
I have implement in wordpress search for the prodcut taxonomy & meta fileds (for extra fileds by advance custome fileds).
Please review below my script.
<?php
$args['post_type'] = 'product';
$args['tax_query'] = array(array(
'taxonomy' => 'product_tag',
'field' => 'slug',
'terms' => slug_name'',
));
$args['meta_query'] = array(array('key'=> $key,
'value' => $val,
'compare' => '=',
));
query_posts( $args );
?>
Dhananjay Kumar |28 Apr at 07:04
Hello,
I have simple need to show a dropdown list of all taxonomy (for tag & category) of prodcut post type of woocommerce.
We have used below script & ite working fine for me.
<?php
$terms_result = get_terms("taxonomy_name");
$slected='';
echo '<select name="fld_name">';
echo '<option value="">Select Option</option>';
foreach( $terms_result as $k => $v )
{
$vslag=$v->slug;
$vname=$v->name;
echo '<option value="' . $vslag . '" >' . $vname. '</option>';
}
echo '</select>';
?>
Sanjana Kumari |22 Mar at 06:03
Issues with the meta canonical path after cahnge with custome path, seems original path rether than as Per New URL.
We have done with below works :
$pathqery=explode('?',$_SERVER['REQUEST_URI']);
?>
remove_action('wp_head', 'rel_canonical');
wp_head();
....
....
Manish Singh |01 Apr at 06:04
Hey guys!
I have had problem with worpress image attachment URL which is creating problem for tech SEO, I found the solution for it how to redirect image URL to attachment page with 301 redirection.
You need to put below following code in FUNCTION.PHP inside you theme file
add_action( 'template_redirect', 'wpse27119_template_redirect' ); function wpse27119_template_redirect() { // Get out of here if not headed to an attachment page if( ! is_attachment() ) return; // Find the $post variable representing the page where we're heading global $post; if( empty( $post ) ) $post = get_queried_object(); // Check if post has a parent if ($post->post_parent) { // Yes so find permalink of parent post $link = get_permalink( $post->post_parent ); // Redirect attachment to the parent post wp_redirect( $link, '301' ); exit(); // always call exit after wp_redirect } else { // No parent so just redirect to home page wp_redirect( home_url(), '301' ); exit(); // always call exit after wp_redirect } }
Sanjay Kumar |29 Mar at 06:03
I have set value in header.php in worpdress and calling the same veriable but not getting value.
Like set $x="abc" in header.php &
echo $x in footer.php
getting blank value, please any one suggest