Tag: code

Visual Composer Get images from “attach_images”

In VC_MAP definition you have:

array(
	"type"        => "attach_images",
	"heading"     => esc_html__( "Screenshots", "text-domain" ),
	"description" => esc_html__( "Add screenshots.", "text-domain" ),
	"param_name"  => "screenshots",
	"value"       => "",
),

In shortcode function you should have: Continue Reading

How to limit letter of WordPress post title

How to limit letter of WordPress post title? Just replace this code

<?php the_title(); ?>

with the following code.

<?php if (strlen($post->post_title) > 35) {
echo substr(the_title($before = '', $after = '', FALSE), 0, 35) . '...'; } else {
the_title();
} ?>

This code is very helpful to limit WordPress post title.

How to show total Downloads in Easy Digital Downloads (EDD)

Follow the below instruction to show total Downloads in Easy Digital Downloads (EDD).

Go to functions.php and paste this code:

function edd_count_total_file_downloads() {
    global $edd_logs;
    return $edd_logs->get_log_count( null, 'file_download' );
}

Then to bring it all together, you can get the total number of customers, products, and file downloads with the following PHP: Continue Reading