dyadica.net

Fun and Games in the Dyadic Sea

Archive for the ‘wordpress’ Category

permalink image comments image
Sunday, 12 July '09: Cross Paging for Wordpress

At times I have found the need (want even desire) to be able to create a Page from a Post.

Yes I know that this can be classed as duplication of content, but some times its nice to be able to archive things in this manner and anyway you only create the content once ;)

So without further ado I introduce to you Cross Paging:

WordPress has the ability to allow authors to assign custom fields to Posts and Pages. This arbitrary extra information is known as meta-data.

We can use this data to ID a desired Posts content for use within a Page, simply by setting a reference to the Posts ID. The page checks to see if an ID has been set,  if so, then draws the content via a custom query: Read..

Tags: , , , ,
permalink image comments image
Monday, 2 February '09: the paper trail 0.6 – the matrix map

Its been just over a year since my last paper-trail posting and in that time a lot has changed. What was once, one massive script has now been condensed down to a few individual function calls.

paper-trail-06

In this post I am going to introduce the code used to create what I have entitled as a Matrix Map (above). Read..

Tags: , , ,
permalink image comments image
Friday, 30 January '09: wordpress tag calls after a custom query

Having an issue with wordpress tag calls not working after a custom query, then try the following:

<?php
$tags = get_the_term_list( $post->ID, 'post_tag', '', ', ', '' ) ;
if($tags){ echo "Tags: " . $tags;
}else{ echo "Cats: "; the_category(','); }
?>

I have also included a category call: the_category(',') to cater for instances where no tags are available, due to no tags having been set or the call being made from a page.

The call breaks down as follows:

get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '' )
Retrieve terms as a list with specified format.
param: int $id Term ID.
param: string $taxonomy Taxonomy name.
param: string $before Optional. Before list.
param: string $sep Optional. Separate items using this.
param: string $after Optional. After list.
return: string

I find this usefull as I have alot of unorthadox (grr the loop) query’s, hope it may help you. Please be aware unless you have a pugin to fix the issue, pages will always be appear as uncategorized.

Tags: , , ,
permalink image comments image
Tuesday, 27 January '09: Revamp Nearly Complete

With the ps-wii-elite engine revamp  95% complete, lets have at what once was so.

A Bit of History

Before I introduce some of the new features and site ethos, here is how things used to be: theme archive

dyadic-night-splash

The dyadic-night implementation (above) was really where ps-wii-elite really started to take shape. Driven by blogging and wordpress experience the theme matured to be both crisper and more accessible. Read..

Tags: , , ,
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
Friday, 12 December '08: Introducing Wordpress 2.7

Wordpress 2.7 was released yesterday. For more info check out the following video:

I cannot really comment yet as I still need to do the upgrade.. perhaps this weekend.

Tags: , ,
permalink image comments image
Tuesday, 5 August '08: Site Issues

Suddenly out of nowhere dyadica.net is suffering from permalink issues and as such is a bit broken at the moment as I have had to revert to ugly (non pretty) permalinks.

This means that there are quite a few broken links around the site.

Usually this kind of thing is a result of a wordpress upgrade however today this is not the case which means that it might have something to do with a simple change host side ?

I will be in touch, KOTD Read..

Cats: Web, wordpress
permalink image comments image
Monday, 21 July '08: URL NOT VALID when trying to manage (anything) posts

Since the upgrade to wordpress 2.6 I have had an issue with the wordpress back end, with a little google play it seems that I am not alone.

http://wordpress.org/support/topic/169789

Essentially all of the back end edit next…n page functions are reporting a http:/// url and thus your browser gives a URL NOT VALID report. As a short term fix I tracked down the url write to $url = ‘http://’ . $url located in the clean_url function within formatting.php.

I fixed the issue by commenting out the line as shown in italics:

if ( strpos($url, ‘:’) === false && substr( $url, 0, 1 ) != ‘/’ && !preg_match(‘/^[a-z0-9-]+?\.php/i’, $url) )

// $url = ‘http://’ . $url; // KOTD – Removed ‘http://’ to make back end work

This may cause additional issues and only time will tell however all is running fine for me so far. I have documented this fix at the following:

http://wordpress.org/support/topic/172749

I hope this is of some help to folks. If you do use it please report back any issues you have caused by the fix.

Tags: , , , ,
permalink image comments image
Wednesday, 27 February '08: New Color Scheme

There have been a few changes here at dyadica.net over the last few days, primarily involving color. Cornily entitled the abyss I’m about 80% through the theme revamp, however doubt is already setting in.

Initial focus behind the current change was to combat some of the old themes non intentional contrast issues, that have been highlighted by a few folks. For reference and comparison here is a picture of the old setup:

dyadicanet-grey.png

Now I really liked the gray theme however feedback indicated that things could look a little washed out… ho humm. Read..

Tags: , , , ,

poll categories

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