• Skip to primary navigation
  • Skip to main content

WP Discuss

Wordpress Research & Analytic

  • Submit
  • Disclaimers
  • About
  • DMCA
  • Privacy Policy
  • Contact

Wp_update_post meta key

  • No categories
  • All

How to Display Popular Posts by Views in WordPress without a Plugin

August 6, 2012 by Leave a Comment

In the past we have shown you how to create a popular post tabber in WordPress using a plugin. That plugin works great out the box for tabbers. However, we wanted more customization in our layout, so we decided to do it without a plugin. In this article, we will show you how to track and display popular posts by views in WordPress without using any plugins. An example of our custom popular post display is shown in the screenshot below: First thing we need to do is create a function that will detect post views count and store it as a custom field for each post. To do this, paste the following codes in your theme’s functions.php file or better in a site-specific plugin : function wpb_set_post_views($postID) { $count_key = 'wpb_post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, $count_key, $count); } } //To … [Read more...] about How to Display Popular Posts by Views in WordPress without a Plugin

Learn More

how to display popular posts in wordpress without a plugin, show popular posts without a plugin, wordpress popular posts, wordpress popular posts by view, how..., pages posts plugin wordpress, wordpress post parent plugin, wordpress display post parent id, wordpress most viewed posts without plugin, wordpress plugin most popular, wordpress plugins most popular

How to Sort Posts by Post Expiration Date in WordPress

March 22, 2012 by Leave a Comment

In the past, we have shared how to expire posts in WordPress using the Post Expirator Plugin . Well, when creating an event listing site, we found this plugin to be super helpful. We can easily delete the event listings that are expired. Secondly, thanks to this plugin, it is really easy to sort posts by post expiration date as well. In this article, we will show you how to sort posts by post expiration date in WordPress. Code Updated to reflect the changes in the plugin where they changed the name of the custom field. Thanks Tajim for letting us know in the comments. In our particular project, we had Events as a Custom Post Type. Now this is for a non-profit that holds like one event per month, so we simply created a loop to put in their events page. You can use the code in your sidebar, or anywhere else you want. <?php $args = array( 'post_type' => 'event', 'posts_per_page' => 15, 'order' => 'ASC', 'meta_key' => '_expiration-date', 'orderby' => … [Read more...] about How to Sort Posts by Post Expiration Date in WordPress

Learn More

event expiration date in wordpress, expire events in WordPress, how to list events in ascending order, post expirator plugin, post expirator plugin wordpress, ..., wp_update_post post_date, wp_update_post post_date_gmt, update_post_meta get_post_meta wordpress, get the date of a post wordpress, get the date of post wordpress, get the date post wordpress, get the date wordpress post

How to Add Tooltip Testimonials in WordPress Themes

October 17, 2012 by Leave a Comment

In the past, we have shown you how to add rotating testimonials in WordPress . While creating the new landing page for WPBeginner WordPress Videos , we took inspiration from something that we have seen StudioPress doing for some time. That is displaying testimonials in a tooltip when the user brings their mouse over on a photo. This technique is becoming an industry standard because we have seen other folks using it as well. In this article, we will show you how to add tooltip testimonials popup in WordPress. Final Result This is what the end product will look like. If you bring your mouse over on a person’s photo, it will show a tooltip testimonial. You can see the live demo here . However, this article will likely outlive the live demo, so attaching a screenshot below: Background: From what we have heard from industry experts, showing prominent human faces tends to add a personal feeling to the page. This is the reason why we wanted to go this route. We did a … [Read more...] about How to Add Tooltip Testimonials in WordPress Themes

Learn More

testimonials, tooltip testimonials, wordpress testimonials, Themes, best b&b wordpress themes, jnews wordpress theme, tedx wordpress theme, add to menu wordpress, add elements to wordpress, add subpage to wordpress page, add subpage to wordpress, how to add button in wordpress editor, add youtube to wordpress, how to add youtube to wordpress

My 25 Best WooCommerce Snippets For WordPress Part 2

December 17, 2013 by Leave a Comment

A few days ago I wrote a post where I listed 25 of the most useful WooCommerce snippets I use and you were many people to ask for more, so today i decided to provide some more snippets for WooCommerce ! Here we go! 1 – Replace WooCommerce default PayPal logo /* * Replace WooCommerce default PayPal icon */ function paypal_checkout_icon() { return 'https://www.paypalobjects.com/webstatic/mktg/logo-center/logo_betalen_met_paypal_nl.jpg'; // write your own image URL here } add_filter( 'woocommerce_paypal_icon', 'paypal_checkout_icon' ); 2 – Replace default product placeholder image /* * goes in theme functions.php or a custom plugin. Replace the image filename/path with your own :) * **/ add_action( 'init', 'custom_fix_thumbnail' ); function custom_fix_thumbnail() { add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src'); function custom_woocommerce_placeholder_img_src( $src ) { $upload_dir = wp_upload_dir(); $uploads = untrailingslashit( … [Read more...] about My 25 Best WooCommerce Snippets For WordPress Part 2

Learn More

best woocommerce themes, best woocommerce theme, best wordpress themes for writers, best theme for woocommerce, best themes for woocommerce, woocommerce themes best, best seo plugins for wordpress, Best WordPress Plugins for SEO, forbes 25 best places to retire, tripadvisor 25 best destinations in the world

WordPress Custom Fields 101: Tips, Tricks, and Hacks

April 16, 2020 by Leave a Comment

Custom fields are a handy WordPress feature that allows you to add various additional data / information to your WordPress posts and pages. A lot of popular WordPress plugins and themes use custom fields to store important data. You can also use custom fields to store your own data and then use it on your website. In this article, we’ll show you how to use WordPress custom fields with some tips, tricks, and hacks. Since this is a lengthy article, we have added a table of contents for easier navigation. What are WordPress custom fields? Adding custom fields in WordPress Display custom fields in WordPress themes Can’t find custom field in dropdown on post edit screen Creating user interface for custom fields Adding Custom Fields Using Advanced Custom Fields Hide empty custom fields with conditional statement Adding multiple values to a custom field Displaying posts with a specific custom key Add guest author name using custom field … [Read more...] about WordPress Custom Fields 101: Tips, Tricks, and Hacks

Learn More

Tutorials, where are custom fields stored in wordpress database, wordpress what are custom fields, where is custom fields in wordpress, displaying custom fields in wordpress, waxing 101 tips and tricks for beginners, 101 filmmaking tips & tricks pdf, 25 gardening tips tricks and hacks, type custom field wordpress, wordpress gutenberg advanced custom fields, wordpress gutenberg custom fields

Copyright © 2021 WP Discuss. Power by Wordpress.