Category: Code Snippets

  • Add Excerpt Support for WordPress Pages

    Add Excerpt Support for WordPress Pages

    [ad_1] By default WordPress does not allow excerpt to pages and it’s probably for good reason because normally you will never use it for pages. That’s why WordPress provides no option to add excerpts to pages through the WordPress admin panel but it’s fairly very easy to enable excerpt for pages too, similarly like posts.…

  • Add link to All Options in WordPress Admin Settings

    Add link to All Options in WordPress Admin Settings

    [ad_1] WordPress have a secret options section that contains all core WordPress settings on one single page. Here’s a quick code snippet to display an “All Options” page to view otherwise hidden data. Just add that code to your theme’s functions.php file and then visit the settings menu in the WordPress admin panel. There you’ll…

  • Show All Media Attachments to a Post

    Show All Media Attachments to a Post

    [ad_1] Prior to WordPress 3.6, we had to run a query to retrieve all media attachments to a specific post. We had to do something like this. // show all WordPress post attachments $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ => ‘any’, ‘post_parent’ => $post->ID ); $attachments = get_posts( $args ); if…

  • Display Featured Post Thumbnails In WordPress Feeds

    Display Featured Post Thumbnails In WordPress Feeds

    [ad_1] WordPress does not allow featured post thumbnails in feeds even if you enable the post thumbnails support. But we have a solution for that. Here is how you can add post thumbnails to your WordPress RSS feeds with a simple function. Just copy and paste this code snippet in your theme functions.php file and…

  • Show Post Content Only to Logged-In Users

    Show Post Content Only to Logged-In Users

    [ad_1] Sometime you want to reward your registered user of your website with a special gift available only to them or maybe you have a important announcement/update for them or you simply want to send a message only to them. To accomplish that, this code snippet below creates a new shortcode with which to wrap…

  • Encode Email Address With Shortcode

    Encode Email Address With Shortcode

    [ad_1] It is generally a bad idea to post your email address in plain text format on your website. It will most likely to get picked up by a spam bot and once it is in the hands of a spammer, your inbox will be filled with spam in no time. WordPress offers a way…

  • Replace Howdy Admin in WordPress Admin Bar

    Replace Howdy Admin in WordPress Admin Bar

    [ad_1] Although it’s not really a huge deal but some people might want to replace the default welcome message “Howdy, admin” in the WordPress admin bar. To replace “Howdy, admin” in WordPress admin bar, you can use this code snippet below. Using this snippet now, your welcome message will read “Welcome! admin” instead of default…

  • Remember Me Checked By Default On Login Box

    Remember Me Checked By Default On Login Box

    [ad_1] By default the remember me checkbox on WordPress login page is always unchecked and you have to select it every time you visit login page of your website. To be honest, it’s really annoying and frustrating. Well, at least for me. Although, it’s a small thing, but it makes the login form more usable…

  • Password Protect Directory on Your Website

    Password Protect Directory on Your Website

    [ad_1] Have you ever wanted a specific directory in your website to be accessible only by a selected number of people. Protecting files on your website from unauthorized users is very important and actually fairly easy. Although, there are numerous methods to password protect directory on a website but we will accomplish this with the…

  • Redirect to Custom Page After Registration

    Redirect to Custom Page After Registration

    [ad_1] On successful registration of a user, WordPress by default shows “Registration Complete. Please check your e-mail.” message. But on a specific project/website you may want your newly registered user to display a custom registration message or you may want to redirect to custom page. In my opinion, it’s a better idea to redirect users…

PROMEX · YOUR ACCOUNT

Login / Register

Use your WhatsApp number. We’ll send you a code to sign in securely.

Your code expires in 5 minutes. Never share it with anyone.