Download Featured Image Link in Post Shortcode

You can use add_shortcode function to register a custom shortcode for your site. For example like this, // add to (child) theme’s functions.php function my_download_featured_image_link( $atts, $content=”” ) { // shortcode should return its output return sprintf( ‘<a class=”download_image” href=”https://wordpress.stackexchange.com/questions/356495/%s”>%s</a>’, // html output of the shortcode esc_url( get_the_post_thumbnail_url(null, ‘full’) ), // defaults to current global … Read more

alternate left – right content inside the loop

You should be able to get the current index in loop from the global $wp_query object. With the help of modulo you can then set an alternating css class for a post. global $wp_query; while ( have_posts() ) { the_post(); $alignment = ( ($wp_query->current_post + 1) % 2 === 0 ) ? ‘even align-right’: ‘odd … Read more

Get x numbers of a woocommerce category products using Wp_Query

Use this query to display woocommerce featured product and replace with yours $meta_query = WC()->query->get_meta_query(); $meta_query[] = array( ‘key’ => ‘_featured’, ‘value’ => ‘yes’ ); $featured = array( ‘post_type’ => ‘product’, ‘stock’ => 1, ‘showposts’ => 6, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘meta_query’ => $meta_query ); Then run your slider action html code inside … Read more

WordPress recent post

From your static page you can make a jQuery GET request ( using jQuery is not mandatory though can be the easiest way) to the default endpoint posts of the WP rest of your installation. More info about WP REST here: https://developer.wordpress.org/rest-api/ <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script> </head> <body> <ul id=”remoteList”> … Read more

Does WordPress disable system functions?

WP by itself does not disable those functions. This is a security mechanism of one of your plugins or theme that is disabling them. It is common practice for malicious code to be hidden by encoding it, and then decoding and executing it when the site loads. You can disable plugins one by one until … Read more