Dplugins Logo
  • Code Snippets
  • Code Request
  • Register
    • Register as Contributor
    • Editor Guidelines
  • Account
  • 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ć

  • Remove Custom Post Type Name from Permalink in WordPress

    Remove Custom Post Type Name from Permalink in WordPress

    Are you Curious how to remove the slug of a custom post type in WordPress? If you’re using CPT UI, there’s an option called With Front but that doesn’t always seem to work. Follow this tutorial, add these two simple functions and the slug will be removed from your custom post type URL. Note –…

    Category: WordPress
    Sumit Singh

    Sumit Singh

    Tags: Custom Post, Permalink
  • How to remove Archive:, Category: Etc. Pre-Title inserts in Archive Titles

    How to remove Archive:, Category: Etc. Pre-Title inserts in Archive Titles

    If you would like to get rid of the “Category:”, “Tag:”, “Author:”, “Archives:” and “Other taxonomy name:” in the archive title, use this little function in Code Snippets The Below can be added using a plugin like Code Scripts organizer or Code Snippets.

    Category: Oxygen, WordPress
    Sumit Singh

    Sumit Singh

    Tags: archive, Category, Titles
  • Add WooCommerce Cart Icon on your website with Cart Item Count

    Add WooCommerce Cart Icon on your website with Cart Item Count

    Here is a way to add WooCommerce cart icon to a menu with the cart item count, it links to the cart page and displays the number of items that have been added to the cart.The code uses three functions which need to be added to Snippet plugin. Create a shortcode for the WooCommerce cart,…

    Category: Oxygen, WooCommerce, WordPress
    Sumit Singh

    Sumit Singh

    Tags: Cart, Tutorial, WooCommerce
  • How to add condition is author archive on oxygen archive page

    How to add condition is author archive on oxygen archive page

    Control the output of elements on archive pages based on the author archive Here’s How Install and activate Code Snippets plugin. Go to Snippets > Add New. Title: Condition Author Archive Type Code Screenshot and code: Condition Screenshot in Archive page If you can any query feel free connect on my FB page https://www.facebook.com/wploversteam/

    Category: Oxygen, WordPress
    Sumit Singh

    Sumit Singh

    Tags: archive, author, condition
  • Fetch best seller of WooCommerce in oxygen repeater / Easy posts

    Fetch best seller of WooCommerce in oxygen repeater / Easy posts

     For retrieving the best buying products in WooCommerce we are using wp_query manipulation with meta_key as “total_sales” and orderby “meta_value_num”. In short we are displaying products as per the total sales number. Here is Screenshot for repeater / easy posts Step 1 – Select Advance WP Query Step 2 – Setup Advance WP Query as…

    Category: Oxygen, WooCommerce, WordPress
    Sumit Singh

    Sumit Singh

    Tags: best seller, Easy posts, repeater, WooCommerce
  • 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ć

    Davor Mlinarić

    Tags: hook

←
1 2 3 4 5
→

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