• Skip to primary navigation
  • Skip to main content

WP Discuss

Wordpress Research & Analytic

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

Update_post_meta return value

  • 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

12 Most Useful WordPress Custom Post Types Tutorials

April 14, 2015 by Leave a Comment

WordPress allows you to create your own custom content types. These content types are called custom post types . You can use them to add custom content like products, reviews, recipes, etc. In this article, we will share the 12 most useful WordPress custom post types tutorials. Video Tutorial Subscribe to WPBeginner If you don’t like the video or need more instructions, then continue reading. 1. When Do You Need A Custom Post Type Before you start creating custom post types or taxonomies on your WordPress site, it’s important to evaluate your needs. A lot of times you can achieve the same results with the default WordPress posts and pages . With the help of built-in categories and tags , you can sort your content in many different ways. With pages you can set up a hierarchical layout of content with parent-child relationship. If you are unclear, then refer to this guide about when do you need a custom post type or taxonomy in WordPress . 2. Adding … [Read more...] about 12 Most Useful WordPress Custom Post Types Tutorials

Learn More

adding custom post types in wordpress, custom post type icons, custom post types, custom taxonomies, custom post type..., wp_update_post custom post type, single.php for custom post type wordpress, wordpress 5 custom post type, wp_remote_post custom post type, get categories custom post type wordpress, get_categories wordpress custom post type, wordpress custom post parent id, update post meta custom post type, get_the_author posts custom post type, taxonomy wordpress custom post type

How to Add Additional Fields to the WordPress Media Uploader

February 7, 2012 by Leave a Comment

While working on a project where we created a very cool gallery powered totally by WordPress attachments and a custom post type, we found a need to add additional fields to the WordPress media uploader. These additional fields allowed us to give each photographer credit by adding photographer name, and their URL on each image page. WordPress stores images as posts in the attachment post type, so adding meta data is just like adding custom fields. Because the WordPress attachments does not have a custom fields UI, we have to add a custom fields to the media uploader in order to collect the meta data. In this article, we will show you how to add additional fields to the WordPress Media Uploader. We will be using the following filters to make the change: attachment_fields_to_edit and attachment_fields_to_save For a project like this, we highly recommend that you create a site-specific plugin and add the following code. However, you can still add the codes in your theme’s … [Read more...] about How to Add Additional Fields to the WordPress Media Uploader

Learn More

add meta data to wordpress attachments, adding fields to the attachment, adding fields to the media gallery, additional fields to the media uploader, how to add...

Creating Highly Customized Post Types with Custom Meta Boxes

January 7, 2013 by Leave a Comment

In the last few years, WordPress truly has evolved into a fully-fledged Content Management System, and it’s when you really unleash some of its functionality that you realize that WordPress can be used to power just about any kind of website. My eureka moment came when a client asked me to build him an order tracking system. Historically, he took orders for medical equipment from reps and did all of his paperwork manually. He would then spend all day on the phone, answering calls from reps either to place new orders or check on the status of an existing order. Well, he sought to change all of that by creating a website where he could input all of his orders, and his clients could then check their status at will, and even get email updates as the order was updated with new information. The idea was that he would then have more time to actually grow his business, instead of spending all day on the phone, doing admin work. CUSTOM POST TYPES The answer to his problem lay in the … [Read more...] about Creating Highly Customized Post Types with Custom Meta Boxes

Learn More

wp_update_post custom post type, menu_order custom post type, menu_order custom post type not working, menu order in custom post type, load_plugin_textdomain custom post type, category taxonomy custom post type, single.php custom post type, wp_remote_post custom post type, update post meta custom post type, get_the_author posts custom post type

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

Copyright © 2021 WP Discuss. Power by Wordpress.