Dplugins Logo
  • Code Snippets
  • Code Request
  • Register
    • Register as Contributor
    • Editor Guidelines
  • Account
  • Woocommerce send SKU as item name to Paypal

    Woocommerce send SKU as item name to Paypal

    Category: WordPress
    cmsexpertss

    cmsexpertss

  • Attach Category to Custom Post type

    Attach Category to Custom Post type

    By the default if you create Custom Post Type attaching Category to it is not possible. On the line: array( ‘post’, ‘resource_libraries’ ), replace “resource_libraries” slug to your custom post type slug. Code Snippet Add Code Snippet Open Scripts Organizer Hit Add new. Scripts Organizer Settings Trigger Location: EverywhereScript Location: PHP

    Category: WordPress
    Marko Krstić

    Marko Krstić

    Tags: Category, CPT, Taxonomy
  • Create admin user programmatically

    Create admin user programmatically

    Sometimes people forget their WordPress admin credentials and email as well so there is no way for them to reset the password to come back in the admin. Following is a little code that you can either add in the functions.php file or set a script in Scripts Organizer and select the PHP option in…

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Add Taxonomy to Admin columns

    Add this to your functions.php and replace CPT_slug and taxonomy_slug Red is added added column

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Add hierarchy option to posts

    If you need to have a parent option for any post custom post to organize inside the admin menu or to loop all child post for some post id just add this code snippet to functions.php

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Change the default loop with CodeBlock

    Place it above Repeater or East Posts

    Category: Oxygen, WordPress
    Marko Krstić

    Marko Krstić

  • Change the default loop with function.php

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Add prev and next post with title and thumb in the same category

    This one is work in progress

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Add prev and next post with title and thumb

    Add this in codeblock in single post template Title is wrapped with h3 and thumbnail is having class (‘your-class-name’) that you can change to your needs.

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Change excerpt length

    Paste this into custom plugin’s functions.php return 15 means 15 words excerpt text being eclipsed. More on WordPress.org

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Remove WordPress default image compression

    By default, WordPress compresses your images for better performance. Every time you upload a JPEG image in WordPress, it would automatically compress the image to 90% quality. All you need to do is paste the following code in your custom plugin’s functions.php When you do make these image quality changes, you want to make sure…

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Limit search to post type

    If you need to display only certain post type ( page, post, custom post) you need to add this to function.php On line 4 change what post type you need. Source: https://www.wpbeginner.com/wp-tutorials/how-to-limit-search-results-for-specific-post-types-in-wordpress/

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Display Taxonomy in post loop in ACF Relationship field

    Product cat is category name for WooCommerce products category. Thanks, Hammad Wali for sharing this useful code!

    Category: ACF, WordPress
    Marko Krstić

    Marko Krstić

  • Remove “Category:” text in archive page title

    The result will be just Category name Default is: Category: Category name If you want to change “Category:” use this: Thanks, Hammad Wali for sharing this useful code!

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Register Print CSS

    after the file path add array, version and then print An entire block stored in function.php should look like this. You can always add it as @media print but with this you will have much more flexibility and load it where you need it. More about Print CSS: https://www.sitepoint.com/css-printer-friendly-pages/ https://www.smashingmagazine.com/2018/05/print-stylesheets-in-2018/

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Change WordPress default excerpt […]

    Place code bellow in your function.php

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Related post in the same category

    This is custom code will loop 3 posts in same categories without a current post with random sorting.

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Load script only when you need it

    In code block when you are using script add to PHP tab: You need to put path from /wp-content/ and not just plugins folder PHP JavaScript Note: Got this trick from a good friend Alexander Buzmakov. Visit his tutorials oxywp.com.

    Category: jQuery, Oxygen, WordPress
    Marko Krstić

    Marko Krstić

  • Sublime text hide hidden files from the sidebar

    Open preferences by pressing Command + “,” And paste the following snippet Taken from: https://gist.github.com/supawaza/8009192

    Category: WordPress
    Marko Krstić

    Marko Krstić

  • Display list of categories that are related to a particular post on your single page

    If you need just parent cagetory Parrent Child Child Child

    Category: WordPress
    Marko Krstić

    Marko Krstić

←
1 … 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