Skip to content
Promex®
  • Services
  • Solving Problems
  • Blog
  • Contact
Promex®

Code Snippets

Various coding collections categorized

Prevent Browser Caching Image Files
Wordpress Snippets

Prevent Browser Caching Image Files

BySupport Admin June 28, 2022

When you are developing a site, you have to refresh page lot of times and you start to get a pretty good feel for what your browser is going to pick up on a single refresh, and what it won’t. For example, I find that if I overwrite an image file on the server, it…

Read More Prevent Browser Caching Image FilesContinue

Check If a WordPress User is Logged In
Wordpress Snippets

Check If a WordPress User is Logged In

BySupport Admin June 28, 2022

Sometimes you want to show different content within WordPress based on whether a WordPress user is logged in or not. WordPress provides a simple way to perform this check with is_user_logged_in tag. It returns boolean true or false value and with the help of this tag, we can create unique messages for members, add images…

Read More Check If a WordPress User is Logged InContinue

Protect .svn Folders From Public Access
Wordpress Snippets

Protect .svn Folders From Public Access

BySupport Admin June 28, 2022

If you use WordPress with Subversion (svn) then you will probably notice .svn (metadata) folders on your server. These folders are used by the Subversion client to keep track of changes and determine what files need to be updated when getting the latest versions. They also contain information about what SVN server you are using…

Read More Protect .svn Folders From Public AccessContinue

Set Minimum Word Count to Publish Post
Wordpress Snippets

Set Minimum Word Count to Publish Post

BySupport Admin June 28, 2022

If you’re running a WordPress blog with multiple authors, then it’s important for you to maintain your blog’s content quality. With WordPress, you can restrict your authors to publish a post without having enough content. Here is a code snippet that lets you set a minimum word count for your WordPress posts. You can paste…

Read More Set Minimum Word Count to Publish PostContinue

Disable WordPress Admin Bar for All Users Except Admins
Wordpress Snippets

Disable WordPress Admin Bar for All Users Except Admins

BySupport Admin June 28, 2022

By default, each registered user has the option of showing the Admin Bar on the frontend and/or back-end of the website. And user can change these preferences, just by visiting Users > Your Profile and choose to show/hide admin bar. Although it’s nice to have for some users but sometimes you don’t want to allow…

Read More Disable WordPress Admin Bar for All Users Except AdminsContinue

Display All WP Query Variables in Wordpress
Wordpress Snippets

Display All WP Query Variables in Wordpress

BySupport Admin June 28, 2022

When developing a WordPress theme or plugin, it may be very useful to be able to output all WP Query variables. Here is a simple code snippet to do it easily. Paste the code below on any files, where you’d like to display the WP Query variables. <?php // display all wp query variables global…

Read More Display All WP Query Variables in WordpressContinue

Add Custom Image Size to Post Thumbnails
Wordpress Snippets

Add Custom Image Size to Post Thumbnails

BySupport Admin June 28, 2022

Here we will see we can we add additional custom image size to post thumbnails in WordPress media uploader to use in our WordPress theme. WordPress has a built-in feature for Post Thumbnails. When you upload an image in any post or in media library, WordPress automatically resize and crop image to some predefined sizes,…

Read More Add Custom Image Size to Post ThumbnailsContinue

Enqueue Scripts and Stylesheets in WordPress
Wordpress Snippets

Enqueue Scripts and Stylesheets in WordPress

BySupport Admin June 28, 2022

If you are a designer or a developer then knowing the proper way to enqueue scripts and stylesheets in your WordPress themes and plugins is very important. Because if you don’t do it proper way then you will probably run the risk of conflicting with other themes and plugins, and potentially creating problems that could…

Read More Enqueue Scripts and Stylesheets in WordPressContinue

Add Custom Post Types to Your RSS Feed
Wordpress Snippets

Add Custom Post Types to Your RSS Feed

BySupport Admin June 28, 2022

WordPress has in-built RSS feed allowing visitors to subscribe. This RSS feed normally consist of just blog posts and it does not include custom post types in default RSS feed. Although WordPress does not offer any setting to include custom post types in RSS feed, but we can modify the WordPress query to keep the…

Read More Add Custom Post Types to Your RSS FeedContinue

Get Current Page ID Outside The Loop
Wordpress Snippets

Get Current Page ID Outside The Loop

BySupport Admin June 28, 2022

With WordPress sometimes you’re not always working inside the WordPress loop. When you are working inside the loop, template tag the_ID can be used to easily get current page ID but if you are working outside the loop then getting current page ID is little tricky. Let’s look at how this is done. Inside the…

Read More Get Current Page ID Outside The LoopContinue

Page navigation

Previous PagePrevious 1 … 3 4 5 6 7 … 22 Next PageNext

Send a message
Contact us!

Visit US

Seattle, WA | Sofia, Bulgaria
Lisbon, Portugal | Beirut, Lebanon

TOS / Privacy Policy

  • Services
  • Solving Problems
  • Blog
  • Contact