Quantcast
Channel: Code Snippets | Newbury New Media
Browsing all 31 articles
Browse latest View live

WordPress Log In / Log Out function

Here’s handy php function which will place a log in / log out link any where you place the function call in a wordpress blog. It’s split into three parts. Firstly the function which does the work, then...

View Article



WordPress Logged in as / Log In function

Here’s another little function that does a simple check on the wordpress user_id and returns “Welcome back, UserDisplayName” when a user is logged in (linking the username to their profile page), and...

View Article

WordPress Dropdown Box for Tags

Ever needed to display your WordPress tags in a dropdown box? Well here’s a handy function to do just that. Let’s break it down, we use the get_tags() WordPress function to create an array containing...

View Article

WordPress Buttons for Admin Users

Here’s a handy line of code that will enable you to place a button which only administrators can see virtually anywhere on your WordPress site. As usual with these code snippets I’m going to divide the...

View Article

WordPress & WooCommerce categories: post_type

I was working on a WordPress site using the popular WooCommerce plugin today and was presented with the problem of trying to differentiate between a WordPress category and a WooCommerce product...

View Article


Image may be NSFW.
Clik here to view.

Useful WordPress Plugins: Browser Shots

I was originally going to use HTML iframes to embed several pages into one document before I discovered this plugin, which renders a HTML document as a picture with link a to the page. For example this...

View Article

Changing the number of items on the WooCommerce shop and category pages

I was recently asked to add a bit of functionality to a site using Woocommerce which would allow the owner to change the number of products that displayed on each shop archive or category page. This...

View Article

Change Your WordPress Login Logo

Here’s a handy php snippet to pop in your themes functions.php file which will replace the WordPress logo on the login page for your blog. Change the /images/you-login-logo.png to point to your logo....

View Article


Liquid Slider

Here’s a really useful script for sliders utilising css and Javascript effects. It’s responsive slider created by Kevin Batdorf which I have found really useful. Click the link here to download the...

View Article


Customize WordPress Excerpts

Here’s a couple of useful functions which allow you to customize the appearance of the excerpts of your posts in the category and post lists. The standard output is [...] and something like eighty odd...

View Article

Image may be NSFW.
Clik here to view.

Flickrpress plugin php 5.4 error and workaround

Recently hit a problem with a client’s site – went to check whether the CMS or any of the plugins needed updating and found that the site wasn’t accessible at all! After the normal idiot checks...

View Article

Image may be NSFW.
Clik here to view.

Bootstrap

We’ve been using the bootstrap frontend framework for a few of our recent projects here at NNM, so I thought I would pop a link on our site! It was originally developed by a couple of guys at Twitter...

View Article

Image may be NSFW.
Clik here to view.

Rock, Paper, Scissors, Lizard & Spock

Think you can beat Sheldon at Rock, Paper, Scissors, Lizard, Spock? Play best of 3Play best of 5 Please note: we don’t claim to own any image or name rights to anything, it’s just a free game!

View Article


Creating a Related Posts section in WordPress

One of my recent projects involved creating a page template for WordPress which had an area showing 3 related posts underneath the main post. Here is how I went about creating that. I began by going to...

View Article

Image Sizes & Post Thumbnails in WordPress

In my last post I briefly touched upon customizing your WordPress sites post thumbnails and images, and I thought it would be useful to expand a little bit in a new post, so here it is! WordPress has...

View Article


Add a list of sub pages to a WordPress page template

Here’s a quick guide on how to generate a list of sub pages in a WordPress template. Firstly create a page which will act as the ‘Parent’ item and then create some other pages and assign the Parent...

View Article

Image may be NSFW.
Clik here to view.

Adding FontAwesome icons to CSS

FontAwesome is a fantastic resource for icons and whatnot, allowing you to easily add a whole variety of great looking icons and logos into websites with just html tags. Every now and again I find the...

View Article


A couple of useful validation tools

Here’s a little round up of some verification & validation tools for checking HTML, CSS and Javascript code. First up the have the original Markup Validation Service provided by W3C,the web...

View Article

Lazy load your post thumbnails

Modern standards and good practice can be easily applied to your website by lazy loading the images contained thereon. The theory is to only load the images when you want to see them (i.e. when the...

View Article

A few useful options built into WordPress for Theme Developers

Here’s how to get the page you have assigned as the ‘Static Front page’ in the Settings. $id = get_option( 'page_on_front' ); Here’s the blog page option. $blog = get_option( 'page_for_posts' ); The...

View Article
Browsing all 31 articles
Browse latest View live




Latest Images