Dplugins Logo
  • Code Snippets
  • Code Request
  • Register
    • Register as Contributor
    • Editor Guidelines
  • Account
  • Display Most Popular Post Without Using Plugin in WordPress

    Display Most Popular Post Without Using Plugin in WordPress

    There are numerous plugins available on the WordPress plugin directory for most popular posts. We are going to display the most popular post using the simple post query based on post views. We will be using post Meta to store the views count and we’ll fetch the posts according to the views count using the…

    Category: WordPress
    Sumit Singh

    Sumit Singh

    Tags: Custom Post, Most Popular
  • Hide Ruller in Oxygen Builder

    This allows you to hide that ruler on the bottom of the builder that often gets in the way of doing mobile responsive work. Set as CSS custom code

    Category: WordPress
    smartsovereign

    smartsovereign

  • Add Media Link To Admin Bar

    Add Media Link To Admin Bar

    This code allows you to add a link to ADD MEDIA from Admin Toolbar, because going all the way to the left and hovering over options is too much work. Set to load in Admin Area only

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: WP Admin
  • Woo: Change the No Product in cart text on the Oxy Ultimate Woo plugin

    Woo: Change the No Product in cart text on the Oxy Ultimate Woo plugin

    This is a snippet for Oxy Ultimate Woo plugin that allows you to change the default “No product in cart” to anything you like. Credit to the Developer, you can see the original code here

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: 3rd party plugins, WooCommerce
  • Woo: How to change CHECKOUT text button on Oxy Ultimate Woo Cart

    Woo: How to change CHECKOUT text button on Oxy Ultimate Woo Cart

    Fo those using Oxy Ultimate Woo Cart component, this is a snippet to change the text on the checkout button to anything you need. This is courtesy of the developer and work perfectly, see original here

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: 3rd party plugins, WooCommerce
  • Remove the Gutenberg Block Library CSS from WordPress

    Note: Do not use this if you want to use Gutenberg. Only if you are using Classing editor. If you are using Scripts Organizer set it as Code block, Trigger location > Everywhere.

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Find all functions hooked to a WordPress action / filter

    Quite simply add this near the apply_filters or do_action.

    Category: WordPress
    Sumit Singh

    Sumit Singh

    Tags: hook
  • Convert WordPress Image Filename To Lowercase

    Convert WordPress Image Filename To Lowercase

    WordPress by default will preserve capitalization in filename for images. To make filenames lowercase automatically. Add the following PHP code snippet in your favorite code manager plugin like Scripts organizer and set it to load on front end:

    Category: WordPress
    Sumit Singh

    Sumit Singh

    Tags: Convert, Filename, Image
  • How to add dynamic ACF Image Alt Text with  in Oxygen

    How to add dynamic ACF Image Alt Text with in Oxygen

    Oxygen page builder Image element does provide the feature to insert an Image-type custom field’s Alt text using the dynamic data. but if you need overwrite then see 2nd option. Step for show alt tag for image. Ensure that your Image field’s Return Format is set to Image Array in your ACF field group. Step 2 Option 1 Option…

    Category: ACF, Oxygen, WordPress
    Sumit Singh

    Sumit Singh

    Tags: ACF, Alt, dynamic, Image
  • Limit WP Search to only Post Title

    By default WordPress search query looks for the searched text in Post Title and Post Content as well. But that makes the search very robust and doesn’t feel a useful search. So here is the code if you want the WordPress default search query to look only in Post Title.

    Category: WordPress
    cmsexpertss

    cmsexpertss

    Tags: search
  • Redirect wordpress back to referring page after login

    Sometimes you have a situation where you want the customer to log in, like a donation page, but you don’t want them to end up at /my-account/ but rather be taken back to the page where they were when they started. This code is useful for donation sites, as well as refer a friend scenarios.

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: WooCommerce, WP Admin
  • Copy code to clipboard

    Copy code to clipboard

    Click anywhere within code block to automatically copy to clipboard. Code is taken from WPJohny’s plugin. But to reduce number of plugins I moved it to Scripts Organizer.

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Log out to home page

    Log out to home page

    This snippet is good for e-commerce stores or anywhere that customers can be logged in, it ensures they don’t see the default WordPress login page, but are instead taken to the home page.

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: Must Have, WooCommerce, WP Admin
  • Edit theme color for mobile

    Edit theme color for mobile

    This snippet allows you to style the very top of your website on a mobile device for that extra touch of professionalism. Change “#000000” to your brand colour. This is a HTML snippet.

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: Must Have, WP Admin
  • Check if website is visible to search engines

    Check if website is visible to search engines

    It’s easy to forget to turn indexing back on after you’ve finished developing a site, this snippet will remind you. No extra plugins are necessary. This should be a part of every template you have. Load this in the admin area only.

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: Must Have, SEO, WP Admin
  • Set post types to private by default

    Set post types to private by default

    Sometimes you have a post type that needs to stay private, like video tutorials for your clients or a quotes for products that should not be seen by the public or indexed by the search engines. The snippet below will allow you to set all posts from a given post type to private by default.…

    Category: WordPress
    smartsovereign

    smartsovereign

    Tags: CPT, WP Admin
  • Post reading time shortcode

    This snipet create a shortcode that you can use on any post to show estimated reading time in minutes. It will simply return a number of minutes. Shorcode: [reading_time] or [reading_time wpm=”100″ gt=”true”] parameter wpm is words per minute value, default is 300 and if you use gutenberg blocks, set gt parameter to true

    Category: WordPress
    Davor Mlinarić

    Davor Mlinarić

  • Show featured image in admin posts and pages table

    Show featured image in admin posts and pages table

    Sometimes is usefull to see if some post or page have feature image or not, this code will add small image at end of tables in admin pages and posts sections. It register new image size 120×120 that is used in this case.

    Category: WordPress
    Davor Mlinarić

    Davor Mlinarić

    Tags: WP Admin
  • Cart count / total price

    Cart count / total price

    With this example you can easily add cart count or total price anywhere on your webshop. This code uses woocommerce add to chart hook that is executed every time when you put something into basket. You just need to add this code anywhere where you wish to show total price. And this snippet will execute…

    Category: WooCommerce, WordPress
    Davor Mlinarić

    Davor Mlinarić

    Tags: hook, WooCommerce
  • Exclude posts or taxonomies from sitemap (slimseo)

    Exclude posts or taxonomies from sitemap (slimseo)

    If you are using SlimSeo plugin it automatically add all posts and taxonomies into sitemap.xml file. This snippet allows you to exclude some post types and taxonomies from sitemap file. In this snippet above from sitemaps file will exclude ‘help’ and ‘slider’ post type, and ‘category’ taxonomy.

    Category: WooCommerce, WordPress
    Davor Mlinarić

    Davor Mlinarić

←
1 2 3 4 5 6
→

3rd party plugins actions admin archive Blocks build Category composite elemenets compression core CPT CSS Custom Custom Post Dashboard Developer development editor Front End gutenberg hook Image img include js load styles loop Must Have notice npm Oxygen plugins publish repeater script scss settings page single product Taxonomy themes Tips WooCommerce wordpress WP Admin WPML

Proudly Powered by DPlugins