Category: Wordpress

How to Get Featured Image from WordPress REST API


Luckily, there are few ways that you can get the featured image after calling the REST API. Method 1: Use Better REST API featured images plugin. I don’t recommend using this plugin unless you are super lazy. Method 2: Add ?_embed at the end of the URL. Take a look at the example below https://example.com/wp-json/wp/v2/posts?_embed Your featured image is … Continue reading How to Get Featured Image from WordPress REST API

How to get author meta into post endpoint in api v2 in WordPress


I added a code block that has some example stuff for context on registering custom routes. Hope it helps! Luckily, there are few ways that you can get author meta after calling the REST API. function wp_get_author_meta($object, $field_name, $request) { $user_data = get_userdata($object['author']); // get user data from author ID. $array_data = (array)($user_data->data); // object … Continue reading How to get author meta into post endpoint in api v2 in WordPress

Woocommerce basic sql queries to fetch data for phpmyadmin


Below are some basic MySQL queries for getting WooCommerce products, categories, orders, and order items from the database. All of the queries assume the default “wp_” prefix to the database tables, so you may need to modify those prefixes if your tables are named differently. I’ve also left some example product and order numbers in … Continue reading Woocommerce basic sql queries to fetch data for phpmyadmin

How to change sites base url localhost to live server from in wordpress


Develope a WordPress site locally can help speed up the development process. In the past, we showed you how to install WordPress on your Windows computer using XAMP or WAMP. Once you have finished the development on localhost, the next step is to move the site live. In this article, we will show you how … Continue reading How to change sites base url localhost to live server from in wordpress

Inserting a Contact Form 7 form in a template file in WordPress


Can I embed a contact form into my template file? Yes, but you cannot insert a contact form shortcode into your template file directly. You will need to pass the code into do_shortcode() function and display its output like this: <?php echo do_shortcode( '[contact-form-7 id="1234" title="Contact form 1"]' ); ?>

My 25 Best WooCommerce Snippets For WordPress Part 2


1 – REPLACE WOOCOMMERCE DEFAULT PAYPAL LOGO1/*2 * Replace WooCommerce default PayPal icon3 */4function paypal_checkout_icon() {5 return 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_betalen_met_paypal_nl.jpg'; // write your own image URL here6}7add_filter( 'woocommerce_paypal_icon', 'paypal_checkout_icon' );2 – REPLACE DEFAULT PRODUCT PLACEHOLDER IMAGE1/*2* goes in theme functions.php or a custom plugin. Replace the image filename/path with your own :)3*4**/5add_action( 'init', 'custom_fix_thumbnail' );6  7function custom_fix_thumbnail() {8  add_filter('woocommerce_placeholder_img_src','custom_woocommerce_placeholder_img_src');9    10    function custom_woocommerce_placeholder_img_src( $src ) {11    $upload_dir = wp_upload_dir();12    $uploads = untrailingslashit( $upload_dir['baseurl'] );13    $src = $uploads . '/2012/07/thumb1.jpg';14      15    return $src;16    }17}3 – REMOVE “PRODUCTS” FROM BREADCRUMB1/*2 * Hide "Products" in … Continue reading My 25 Best WooCommerce Snippets For WordPress Part 2

WORDPRESS INTERVIEW QUESTIONS AND ANSWERS


1. what is WordPress. WordPress is a CMS (Content Management System) based on php and mysql. Its free and open source blogging tool. Its now most popular blogging tool on internet network. The main reason for its popularity is the administrator panel is very user friendly, easy to use and manageable for the layman user. … Continue reading WORDPRESS INTERVIEW QUESTIONS AND ANSWERS

SOME USEFUL LINKS FOR YOUR WORDPRESS WEBSITE


This is the list of Some useful plugins you need for their wordpress website: WP_Query Argument List - http://www.billerickson.net/code/wp_query-arguments/ Custom Post Sort Plugin - http://wordpress.org/plugins/post-types-order/ Advanced Custom Field Plugin - http://wordpress.org/plugins/advanced-custom-fields/ Limit Login Attempts - http://wordpress.org/plugins/limit-login-attempts/ Maintenance Mode - http://wordpress.org/plugins/maintenance-mode/ Taxonomy Images - http://wordpress.org/plugins/taxonomy-images/ WordPress Popular Posts - http://wordpress.org/plugins/wordpress-popular-posts/ WP Security Scan - http://wordpress.org/plugins/wp-security-scan/ Contact … Continue reading SOME USEFUL LINKS FOR YOUR WORDPRESS WEBSITE