Dplugins Logo
  • Code Snippets
  • Code Request
  • Register
    • Register as Contributor
    • Editor Guidelines
  • Account
  • Add link inside WP-Admin topbar

    Usually, some common settings are hidden under submenus and several clicks. To be efficient I need to have them in 1 or 2 clicks and highlighted. That’s why I made this small code snippet to add links and coloring for each menu item. Single menu item Multiple menu items Code Implementation Open Scripts Organizer. Code…

    Category: WordPress

    Marko Krstić

    Tags: Topbar, WP Admin
  • Register image sizes that are visible in the Editor insertion

    Register image sizes that are visible in the Editor insertion

    You registered new image size, regenerated all images but still when you insert image element your image size is still not shown. To explain first what are the image settings inside the brackets: product-main = image name 1440 = width in pixels 800 = height in pixels true it will be cropped. set false if…

    Category: Oxygen

    Marko Krstić

  • WordPress Admin Dark Theme

    WordPress Admin Dark Theme

    WordPress sadly only have “Light mode”. If you have problem with that hard contrast and big light screen you need to install heavy plugins that only bloats your server and admin resources. Scripts Organizer Setup Select admin only condition. With that option CSS will be served only to the logged in users. Use PHP Block…

    Category: WordPress

    Marko Krstić

  • Scripts on Excluded pages

    Scripts on Excluded pages

    At the moment we have option to select pages on which you want to apply scripts. Thats why I made a small code snippet to help you create this option as well. Write Page, Post ID or Slug on witch pages you don’t want that script is applied and it will be applied on all…

    Category: WordPress

    Marko Krstić

  • Modify or Disable Heartbeat API Without Plugin

    Modify or Disable Heartbeat API Without Plugin

    In 2013 WordPress introduces Heartbeat API – a feature that allows your browser to automatically communicate with the server. However, there are a couple of drawbacks to this feature. If you use a shared hosting plan, you need to take a closer look at the CPU usage of your server. That’s because some hosting companies might suspend your account…

    Category: WordPress

    Marko Krstić

  • Color Admin Menu Items

    Color Admin Menu Items

    The easiest way to organize Admin Menu is to add specific colors to it.I personally like to color items I use daily. Code Snippet Add Code Snippet Open Scripts Organizer Hit Add new. Scripts Organizer Settings Trigger Location: EverywhereScript Location: PHP How to find plugin target to write CSS? Hover over item you want to find info and…

    Category: WordPress

    Marko Krstić

    Tags: WP Admin
  • 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ć

    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ć

  • Rotate logo on scroll

    If you need to rotate logo while you are scrolling the page like on Matthias Altmann’s website here is the code he shared with us Example: https://www.altmann.de/

    Category: jQuery

    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ć

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

  • Manual query get complex data

    Paste this into code block to get that data. Paste that data into Query of Easy posts or Repeater. With this, you can put in query data from ACF Pro as well Credits to: https://wpdevdesign.com/how-to-generate-the-query-string-for-easy-posts-in-oxygen/

    Category: Oxygen

    Marko Krstić

  • Change the default loop with CodeBlock

    Place it above Repeater or East Posts

    Category: Oxygen, WordPress

    Marko Krstić

  • Change the default loop with function.php

    Category: WordPress

    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ć

  • Tabs with CSS only

    HTML structure CSS Example on JSFiddle

    Category: CSS

    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ć

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

  • Flickity slider hide dots if only 1 slide

    This can be done easily with 1 line of CSS code and only-child selector:

    Category: CSS

    Marko Krstić

  • Images are not sharp enough when they are scaled down

    Oxygen adding class to images by default “.ct-image”. To target all the images use img tag or .ct-image. If you want to play with more options there are some couple of more settings:

    Category: CSS, Oxygen

    Marko Krstić

←
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