Ryan Paul

Archive for the ‘Websites’ Category


Useful WordPress Stuff

I’m constantly looking and re looking for various tiny tricks and tips I’ve used over the years on multiple WordPress powered websites. I’ve grown sick of trying to remember which sites, and so I’ve spent a few hours compiling this list. This list is primarily for my own use, but if you should find it helpful… then knock yourself out :)   This list will definitely be expanding so I can use it for a one-stop-shop for every website I build.

But for now folks.. I hope you find this stuff useful.

I’d love to hear from people if anyone uses these… so leave a comment!

You plum!


Individual Dynamic Link To A Post / Page:
<a href="<?php echo get_page_link(1);?>"><?php echo get_the_title(1) ?></a>
This will output a single dynamic link to a post or a page.


Individual Dynamic Link To A Category:
<a href="<?php echo get_category_link(1);?>"><?php echo get_cat_name(1) ?></a>
This will output a single dynamic link to a category.


Front End Delete Post Link For Authorised Users

If you don’t have a functions.php in your WordPress theme, create ‘functions.php’ and add this function to it.

function wp_delete_post_link($link = 'Delete This', $before = '', $after = '')
{
global $post;
if ( $post->post_type == 'page' ) {
if ( !current_user_can( 'edit_page', $post->ID ) )
return;
} else {
if ( !current_user_can( 'edit_post', $post->ID ) )
return;
}
$link = "<a onclick=\"return confirm('Are you SURE you want to delete this post/page?')\" href='" . wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?action=delete&amp;post=" . $post->ID, 'delete-post_' . $post->ID) . "'>".$link."</a>";
echo $before . $link . $after;
}

Then add the following into your template within The Loop wherever you wish the delete link to go.
<?php wp_delete_post_link('Delete', ' <strong class="delete">', '</strong> ') ?>


Front End Delete Comment Link

Open ‘comments.php’ and look for the edit comment link which will be something like: <?php edit_comment_link(‘Edit’,’ [ ',' ] ‘); ?> and add the following after it:
<?php if (current_user_can('edit_post', $post->ID)) { ?><strong>[ <a onclick="return confirm('Are you SURE you want to delete this comment?')" href='<?php echo wp_nonce_url("/wp-admin/comment.php?action=deletecomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID.""); ?>'>Delete</a> ]</strong><?php } ?>


Get Slug:

You should be able to put the code below into your functions.php… or into the html head of your theme:
<?php
$post_id = get_post($post->ID); // get current post or page
$slug = $post_id->post_name; // define slug as $slug
?>

Then use the following to echo the slug:
<?php echo $slug; ?>


Retrieve Post ID Outside of the Loop

Put this code into your functions.php:
function function_name() {
global $wp_query;
$thePostID = $wp_query->post->ID;
}

Then use the following to echo the Post ID:
<?php echo $post->ID ?>

Awesome political websites

For a lot of people, websites are the first point of contact they’ll have with a particular organization/business/government entity.  As with all groups I believe that the quality of the website should reflect the quality of the group.  I’ve compiled a list of some political websites of various international government departments that I think are awesome. Read more...

Sweet CSS

If you check on Google for something like ‘awesome css design’ you’ll find a plethora of information.  So I figured why should I not add a very short blog of my own about the subject.  Here’s only three, but I’ll add another soon.

Simple Art

Simple Art

Studio 7 Designs

Studio 7 Designs

Point of Entry

poe-460x151

Awesome Cover Songs on Youtube

Alicia Keys – No One ( sung by Sheena Melwani)

YouTube Preview Image

Billy Jean – Michael Jackson ( played by Jose Feliciano )

YouTube Preview Image

Web Designing and Notepad

I’m a web designer by trade. It’s what I do for a living and what I do to bring in a meager income to partially support my children.

So many times I read about web designers bragging that they still code their html in Notepad. About 95% of people making this claim are flat-out lying. Only a moron with NO BRAINS and no time-management skills would code an entire website solely in Notepad.

I know from experience… being in the field that web designers use programs like Coffee Cup, Web Studio, Dreamweaver, GoLive and Homesite. Some archaic douche bags still use Frontpage but they’re in the minority.

Some people might code SOME of their html in ‘code’ view in these HTML editors, but they do it much like me. If I’m doing a complexed layout using CSS design instead of tables, then I’ll type the html by hand and keep checking it in WYSIWYG view. But most people still use tables which suck. There’s VERY FEW situations when a table is a necessity but mostly they’re crap and are horrendous for search engine optimisation. Anyone using them for a website layout in this day and age knowing there is something better just needs a slap.

So please… if you’re claiming you use Notepad please stop lying because the chances are that you don’t (at least to make complete websites).

CSS Zen Garden

Most people in the design industry know about CSS Zen Garden.  It’s a website designed to show the power of css design.  There is a set amount of content which never changes, and web developers are invited to send in their own css files to style the website to their own design.

They have no physical access to the site, so they can’t change the content according to their design.  Their design changes the content layout.

It’s a truly excellent site, showcasing some fantastic designing and css skills.   Some of the submissions go for more fancy tricks rather than good design, but even those are decent.

http://www.csszengarden.com

A Blog Post About Blogging

Of late I’ve started to fall in love with WordPress. The sheer amount of functionality provided out of the base package, combined with the awesome power of the hundreds of plugins is definitely making my life more fulfulling.

I recently heard about a guy who earns a six-figure income from blogging. No doubt I would LOVE to do that… even though the $451 a day he earns from Google Ads dwarfs my approximately $7 per day… I would blog if I made no money and nobody EVER came to my website.

For instance… my day job is as a web developer. Content management systems are a huge part of what I do every day. I’ve tried all of the major ones. My boss was very apprehensive on using WordPress in a professional environment as a CMS. It took the crashing of a server with Drupal on it and the time it took me to construct that site, to get him to agree to have the same site rebuilt in WordPress.

On my WordPress Plugins page, I’ve listed all of the WordPress plugins I use on various personal websites. So far I’ve used nearly all of them on work-sites in the last three weeks that the boss has agreed to allow WordPress in the workplace.

The flexibility and raw power is making WordPress one of the great loves of my life. I’m not really sure what makes me feel like this either hahahaha. Maybe it’s just having that administrative control to do what I want, where I want and how I want.

I can tell anyone out there who’s considering building a static OR interactive website with one of the major ones like Drupal, Joomla, PHPNuke, PostNuke, Xoops or anything else… FORGET that. Use WordPress. The plugins are where it’s at.

Plodding On

As usual… life plods on. Work is going good. Very very busy.

Life on the home front is same as always. Rocky at times, great at others. My daughter is doing excellently. I have great trouble getting her to drink her milk all at once… the only time I don’t have problems feeding her is in the morning around 6am.

Lorraine doesn’t have problems getting her to eat… and didn’t with Nicolas either, even though he was with me 90% of the days when he was still on the bottle. It used to bother me that my children eat better for their mother than me, but it doesn’t much at all anymore. I figure it’s just one of those things that has no rhyme or reason that I can figure out. So it’s all good!

I’m building my own community portal at http://www.kenoralife.ca to try and compete with long standing, but lack lustre local competitors mykenora.com and gokenora.com. Kenora Life offers free email addresses, and will eventually offer free webhosting, classifieds and a search engine. All in good time!

I’m sure most educated people have heard the latest bullshit in the Middle East – Iran has captured 15 British Navy sailors. They’ve said that the Brits were in Iranian waters… which is about as sure as anything could be sure wrong! Iran gave one set of coordinates… and then when the Navy pointed out those were still inside Iraq’s waters, Iran changed to another set of coordinates. They won’t release them, and the wimp in 10 Downing Street won’t launch a Cruise missile strike against Iran. If Margaret Thatcher was in power… this would have been over 5 days ago.

If Iran acts this way and tries to bully people now… what can we expect with a nuclear armed Iran? We need to bomb the hell out of the Ayatollah, and Ahmenedin

It irks me that Iran’s military could sneak up on ours without being detected which is almost impossible… so what the likely story is that either there was a failure of command on the HMS Cornwall, or they were in Iranian waters and were testing response times.

It irks me that it took President Bush a week to publicly say anything. I’ve been reading various peoples comments about this. One said that the Americans would have blown the Iranians out of the water… but instead we just surrender humbly and write rambling letters.

Put me in charge and I’ll have this sorted out in a week – launch a couple of Trident warheads at Tehran, and take a British aircraft carrier to the Persian Gulf and keep it there permanently… that’d sort out those stupid f**king Persians. Why don’t they just stick to playing chess and making rugs?