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_permalink(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&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&c=$comment->comment_ID&_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 ?>
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...
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
Studio 7 Designs
Point of Entry
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).
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.
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.