IGR WordPress server

Note: Edit this page in Text mode. Do not switch to Visual and back again – it screws up the code formatting examples (strips out the entity codes and replaces them with the actual characters).


  1. Attaching Images and Other Files to Posts
    1. Uploading New Files
    2. Creating Galleries
    3. File Upload Best Practices
  2. Avatars
  3. User Roles in this Labbook
  4. Embedding Mathematics in Posts
  5. Adding code to posts
  6. Linking to Labbook entries from the Wiki
  7. Using Feeds
    1. Getting email notifications
      1. Revoking your Feed Keys

Attaching Images and Other Files to Posts

When creating/editing a post, you can upload images or other files by clicking the ‘Add Media’ button above the edit panel. From here, you may choose an existing file (i.e. one that has already been uploaded for use in another post), or upload a new one. In addition, some browsers allow for a direct upload of images that you have in your clipboard (tested at least with Opera/Chrome on Windows). Just press Ctrl-V while in the text-editor field and it will automatically upload and insert the image.

Uploading New Files

If you wish to upload a new file, click the ‘Upload’ tab from the ‘Add Media’ panel. You may then drag and drop the file you wish to upload onto this panel, and WordPress will upload the image for you. Once complete, you may then edit the title and description of the file you have uploaded by clicking on it. Once you’re happy with it, select it and click ‘Insert into post’.

If you receive an error message saying the file format you have tried to upload is not supported, contact an administrator so they can add this format to the list of safe formats.

Creating Galleries

If you are uploading many images to your post, you might find it useful to display these images in a gallery. A gallery is a grid of pictures that can be displayed in thumbnail size in your post, and a reader can then click on each image in turn to open up a large version.

To create a gallery, upload your media as per the above section and then, within the media manager, click ‘Create Gallery’. In here, you can select multiple images that you wish to include in your gallery. Once you’re happy, click ‘Create New Gallery’. This then opens a page where you can provide a caption for each image, if desired. Once you’re finished, click ‘Insert gallery’ to add it to your post.

File Upload Best Practices

It is most useful if you can provide images, particularly plots, in more than one format:

  • It is helpful to make your uploaded images appear large when embedded in posts. You can do this by selecting the ‘Large’ size from the ‘Size’ menu when you edit media after uploading it. If you’ve uploaded a particularly small image, then select ‘Full Size’ so that it is not shrunken. Users can always view the full size image by clicking on it – this is just for the purposes of making your labbook entries look nice.
  • For plots, try to provide both a raster graphic (e.g. PNG format) for embedding into the post as well as a vector graphic (e.g. PDF) for separate viewing.
    • For MATLAB, please also upload the FIG file, if available.
  • In general, try to provide the files which will allow another user to manipulate the plots you’ve provided. With a MATLAB FIG file, it is possible for another user to change the axis titles, units, grid, scaling and superimpose other data onto your plots, which is very handy.
  • For plots produced by scripts, add the scripts to an appropriate place on the SVN and provide a link in your post to the SVN location. You can manually navigate to the file location using the web SVN viewer.



You can set your own avatar by registering on Gravatar. Once registered, upload a picture of your choosing and associate it with the email address used on this labbook (probably your @glasgow.ac.uk address). Then WordPress will be able to show your picture next to your contributions.

User Roles in this Labbook

The labbook software defines certain ‘roles’ which users may have:

  • Subscriber: the ability to read posts and make comments, but not create posts. This user role should be used for past project students and anyone who should have access to read the logbook but not create or edit content.
  • Contributor: the ability to create new posts and edit their own posts, but not to publish (‘make visible’) them. This user role should probably not be used as it is intended for news websites.
  • Author: the ability to create new posts and edit their own posts, and to publish their own posts. This is probably the role to give project students.
  • Editor: the ability to create, edit and publish their own posts and other peoples’ posts. This is probably for people who work on the blog every day.
  • Administrator: all abilities to manage the site, including the management of users, categories and site settings.

Embedding Mathematics in Posts

This labbook uses a technology called MathJax, which allows you to embed LaTeX-style mathematics inside your posts. See this for more details about syntax to use. The only caveat here is that the dollar symbols (‘$’ and ‘$$’) do not define an equation like in LaTeX. Instead, use the ‘latex’ tag to open and close your equation syntax:

[latex]E = \frac{hc}{\lambda}/[latex]

This then renders, within your post, something like this:

\(E = \frac{hc}{\lambda}\)

Adding code to posts

Note – it is highly recommended to do this using Text editing mode, not Visual mode!

Using the SyntaxHighlighter Evolved plugin, you can display highlighted code from a variety of languages. To do this wrap your code in a [code] block (as opposed to the standard <code> block). For example:

print("Hello, World!")

This displays as

print("Hello, World!")

We can specify what language is used:

[code lang="python"]
print("Hello, World!")

print("Hello, World!")

Including LaTeX!

[code lang="latex" gutter="false"]
E = \frac{hc}{\lambda}

With the line numbers off as well…

E = \frac{hc}{\lambda}

There is a WordPress support document listing the languages available and the other options that can be used. You can change the colour scheme, alter or remove the line numbering, and highlight lines for example.

[code lang="matlab" title="femur.m" highlight="2,9-11" gutter="true"]
Bunch of matlab code...

% Import an STL mesh, returning a PATCH-compatible face-vertex structure
fv = stlread('femur.stl');

patch(fv,'FaceColor',       [0.8 0.8 1.0], ...
         'EdgeColor',       'none',        ...
         'FaceLighting',    'gouraud',     ...
         'AmbientStrength', 0.15);

% Add a camera light, and tone down the specular highlighting

% Fix the axes scaling, and set a nice view angle
view([-135 35]);

Linking to Labbook Entries from the Wiki

Each labbook entry has a unique ID, which you can see at the start of each post in front of the author name.


You can use this ID to link from the Wiki to the labbook, like this:

[[ssm>4535|see this labbook post]]

Using Feeds

This labbook supplies numerous RSS feeds. Feeds are a way of summarising content on sites, and allow you to keep track of updates to this labbook. Usually, feeds are used in combination with a web browser or mail client, but there are also some websites which allow you to manage your feed subscriptions. A non-exhaustive list of feed readers can be found on Wikipedia.

Getting email notifications

You can use RSS feeds in combination with a feed reader service to receive email notifications when new posts or comments are made. An example of such a service is Blogtrottr, but there are others.

Since this labbook requires a username and password to read, by default RSS feeds must include a unique hash key associated with your account. This allows your feed reader service to access the labbook posts without a username and password.

Getting the RSS feed URLs for posts and comments is easy. On the front page, scroll down to the bottom of the sidebar to the ‘Meta’ section and you will find two URLs: ‘Entries RSS’ and ‘Comments RSS’. Use these URLs in your feed reader.

Getting the RSS feed URL for a category feed is not so straightforward:

  1. Load the category page in your web browser.
  2. Open the page’s source code (in Firefox, right click somewhere on the background of the page and click ‘View Page Source’)
  3. Find on the line, near the top, that says something like this:
    <link rel=”alternate” type=”application/rss+xml” title=”Speedmeter Labbook &raquo; [Name] Category Feed” href=”…”/>, where [Name] is the category name.
  4. The bit inside the ‘href’ block contains your unique URL to subscribe to post updates. Use this URL in your feed reader.

Revoking your Feed Keys

If, for whatever reason, you wish to stop a feed reader being able to access feeds on the labbook, you can revoke the feed key using the dashboard. Simply navigate to your own profile, scroll down to the bottom of the page and revoke the relevant key.