Dplugins Logo
  • Code Snippets
  • Code Request
  • Register
    • Register as Contributor
    • Editor Guidelines
  • Account
  • Custom language link WPML

    Here’s a PHP snippet that you can use to return a custom link to a specific language for the current page using WPML. This will output the custom link for the specified language code and can be used on any page. Example 1: This will output a link that says “Switch to French” and links…

    Category: Oxygen, WordPress

    Davor Mlinarić

    Tags: WPML
  • Extend Block page with category and screenshoot

    Extend Block page with category and screenshoot

    This php snippet will provide you with a more efficient way of organizing and keeping track of your blocks in Oxygen builder.

    Category: Oxygen, WordPress

    Davor Mlinarić

    Tags: Blocks, WP Admin
  • Custom Block Library Categories

    This code will add additional categories into oxygen block library

    Category: Oxygen, WordPress

    Davor Mlinarić

  • Hide products with zero price

    Just a simple function that will hide products that have price set to 0. I found it useful when I was importing products from some external source where client decided to add prices manually. In case that there is no price set to 0, where price is empty this snippet could be used.

    Category: WooCommerce

    Davor Mlinarić

  • 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ć

  • 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ć

    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ć

    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ć

  • Add text after price

    Add text after price

    Sometimes is usefull to add additional text under the product price. With this hook you can easily show additional text just under the price. You can use ScriptOrganiser, CodeSnippets or any other similar plugin. This hook could be extended to show message only on specific products. In this case you will need to add ID’s…

    Category: WooCommerce, WordPress

    Davor Mlinarić

    Tags: hook

3rd party plugins admin after_body Alt archive Blocks Category clean up composite elemenets core CPT CSS Custom Custom Post Dashboard flexslider Front End FSE full site editing Gallery hook HTML Image load styles Must Have notice Oxygen Password Permalink plugins Post List Publish Date repeater settings page share single product Taxonomy Taxonomy Term themes Tips Topbar WooCommerce wordpress WP Admin WPML

Proudly Powered by DPlugins