get avatar from facebook graph [closed]
I found the solution! global $current_user; get_currentuserinfo(); echo get_avatar( $current_user->ID, 48 );
I found the solution! global $current_user; get_currentuserinfo(); echo get_avatar( $current_user->ID, 48 );
$user1 = $wpdb->get_results(“SELECT * FROM diary_user_form_storage”); foreach ($user1 as $key => $value) { $productString = stripslashes($value->product); $product=json_decode($productString,true); $error_p = implode(‘ ‘, $product[0]); echo $error_p; } Out will be PRODUCT 2 PRODUCT 5
If you want to get the page ID you need to use the $post global. À simple example function my_function(){ global $post; $post_id = $post->ID; // Etc } Note that it can return a null value for certains types of page (archive).
If you need to append something to EVERY post_title you have, you should: Make your loop with WP Query, check Codex Then, use get_the_ID, to get the specific post ID, check Codex Then, use the ID to get the ACF field from that specific post like get_field(‘name-of-the-field), check the documentation Don’t forget to use wp_reset_query(), … Read more
Did you install any new plugin? If so, try to deactivate that plugin first. What version of WooCommerce are you using? If you are using an outdated one, try updating it to the latest version. Can you try to add a dummy product and add a price on it? If the price still did not … Read more
You shouldn’t edit the parent theme to add functionality instead use child theme. To convert default wordpress gallery to your custom image gallery ( in your case carousel ), you can use jQuery.
I noticed there was a newer version of WordPress Desktop App (v3.1.0) and when I tried to install it the installer said it could not update a file. I know from previous experience that this often means that the wordpress desktop app was still running in the background (even after I closed it). To me … Read more
Your query is structured a little weird. $my_query = new WP_Query( array( ‘posts_per_page’ => 5 ) ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $the_query->the_post(); // Your desired template code } // Close while() // Restore original Post Data wp_reset_postdata(); } // Close if() This should be all you need to set … Read more
Yes, the WordPress template hierarchy provide a range of templates files to use. In this case, you should look at the single-$post-type.php file. $post-type being your custom post type slug. Include your template code, including ACF get_field calls, and the pages will look the same, but use the content from each post.
Here’s what I believe is an updated version of one of the other answers’ comments. This function replaces the width and height attributes, but OP wanted to change the src. I imagine the solution would be similar, except using preg_replace to replace the src instead. add_action(‘woocommerce_single_product_image_thumbnail_html’,’remove_single_product_image_attrs’,10,2); function remove_single_product_image_attrs( $sprintf, $post_id ){ return preg_replace( ‘/(width|height)=”\d*”\s/’, “”, … Read more