dyadica.net

Fun and Games in the Dyadic Sea

Posts Tagged ‘css’

permalink image comments image
Tuesday, 27 January '09: Wordpress Gallery CSS

Time for another wordpress mod driven by the ongoing ps-wii-elite theme revamp:

Since the advent of wordpress 2.5 the built in gallery system has a habit of deploying a “nice” chunk of bespoke css slap bang in the middle of your web page, where it cannot be reached/styled by normal methods.

Many folks have developed plugins to remedy this factor however I prefer to remove it completely, time for another wordpress hack:

wp-includes>media.php  contains the evil code around line 641, detailed as follows:

$output = apply_filters('gallery_style', "
<style type='text/css'>
.gallery {
margin: auto;
}
.gallery-item {
float: left;
margin-top: 10px;
text-align: center;
width: {$itemwidth}%;}
.gallery img {
border: 2px solid #cfcfcf;
}
.gallery-caption {
margin-left: 0;
}
</style>
<!-- see gallery_shortcode() in wp-includes/media.php -->
<div class='gallery'>");

Simply edit this to equal the following, thus removing the css:

$output = apply_filters('gallery_style', "
<!-- see gallery_shortcode() in wp-includes/media.php -->
<div class='gallery'>");

The gallery can now be styled in the usual manner using the following definitions:

.gallery {}
.gallery-item {}
.gallery-icon {}
.gallery-caption {}

Simple eh.. I have left things pretty raw at this stage as I am planning to add some thickbox deffinition functionality at this point.  This was another Wordpress hack brought to you by dyadica.net.

Tags: , , ,
permalink image comments image
Sunday, 11 January '09: Adding a classified span tag to wordpress

With my ongoing theme revamp I have decided that I would like to have the numeric’s of my ordered lists to be a separate color from the content. Though there are methods for achieving this with newfangled css this causes some browser compatibility issues so I believe.

grr have lost the link….worked fine in FF3 but not IE..

The easiest method therefore is to wrap the content in an additional tag for standard css styling. For this purpose I have chosen to use span tags, however as this functionality might be quite commonplace I also decided to add a new quicktag to wordpress to cater.

When you are editing a post or writing a new post in WordPress, you might have noticed those buttons above the editing box. They add WYSIWYG type functionality to the WordPress editor for common functions such as bolding, italics and linking. WordPress refers to these buttons as Quicktags.

quicktags

If you have a function that you use often it is very simple to add it to the  HTML editor Quicktag bar. For this example, I am going to add a button that creates a span tag and I’m going to expand upon this a little by adding facility for a css class within the tag, just in case it might be needed. Read..

Tags: , , , ,
permalink image comments image
Monday, 20 August '07: Valid XHTML 1.0 Transitional!

Dyadica.net Valid XHTML 1.0 Transitional!
Dyadica.net Valid CSS

Tags: , , , ,

poll tags

css | xhtml | dyadica.net © admin 2010 | powered: wordpress | fuel: ps-wii-elite | top | sign-up