ecommerce

[et_pb_db_php_code code=”<?php
// Get the number of published posts
$posts = wp_count_posts('post');
$published = $posts->publish;

// Get the number of comments replied to by user ID 1
$comments = get_comments(
array('user_id' => 1, 'count' => true)
);

// Get today's date
$current_date = date('F j, Y');

// Output the counts
echo %22As of $current_date, Divi Guy has written <strong>$published</strong> posts and <strong>$comments</strong> comments (so far).%22;
?>
” code_to_render=”/* nonce:ignored */
<?php
// Get the number of published posts
$posts = wp_count_posts('post');
$published = $posts->publish;

// Get the number of comments replied to by user ID 1
$comments = get_comments(
array('user_id' => 1, 'count' => true)
);

// Get today's date
$current_date = date('F j, Y');

// Output the counts
echo %22As of $current_date, Divi Guy has written <strong>$published</strong> posts and <strong>$comments</strong> comments (so far).%22;
?>
” code_base64=”PD9waHAKLy8gR2V0IHRoZSBudW1iZXIgb2YgcHVibGlzaGVkIHBvc3RzCiRwb3N0cyA9IHdwX2NvdW50X3Bvc3RzKCdwb3N0Jyk7CiRwdWJsaXNoZWQgPSAkcG9zdHMtPnB1Ymxpc2g7CgovLyBHZXQgdGhlIG51bWJlciBvZiBjb21tZW50cyByZXBsaWVkIHRvIGJ5IHVzZXIgSUQgMQokY29tbWVudHMgPSBnZXRfY29tbWVudHMoCiAgICBhcnJheSgndXNlcl9pZCcgPT4gMSwgJ2NvdW50JyA9PiB0cnVlKQopOwoKLy8gR2V0IHRvZGF5J3MgZGF0ZQokY3VycmVudF9kYXRlID0gZGF0ZSgnRiBqLCBZJyk7CgovLyBPdXRwdXQgdGhlIGNvdW50cwplY2hvICJBcyBvZiAkY3VycmVudF9kYXRlLCBEaXZpIEd1eSBoYXMgd3JpdHRlbiA8c3Ryb25nPiRwdWJsaXNoZWQ8L3N0cm9uZz4gcG9zdHMgYW5kIDxzdHJvbmc+JGNvbW1lbnRzPC9zdHJvbmc+IGNvbW1lbnRzIChzbyBmYXIpLiI7Cj8+Cg==” code_hash=”791915cab1dda2925e8b6ed19eecd3f683b085cc29e5e3974dd7a217d23503b0″ _builder_version=”4.21.0″ _module_preset=”default” code_output_text_color=”#FFFFFF” code_output_font_size=”18px” code_output_line_height=”1.4em” custom_margin=”||15px||false|false” global_colors_info=”{}”][/et_pb_db_php_code]

More Tips

Looking for some deals?

Divi PHP Code Module

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields