Archive for the ‘Wordpress’ Category

WordPress PHP custom theme functions.php hook

Wednesday, July 28th, 2010

In your theme (wp-content/themes/YourNewTheme) create or find functions.php

and start making whatever you need.  It’s a nice clean place to put things without hacking away at your code,

dynamically inserting with JS, or whatever other measure you’ve either employed in the past, or are considering now…

for example,

<?php
//My own footer hook
function my_footer() {

//code to execute

?><div class=”bigText”>blah blah blah</div><?

}

?>

then, wherever you like, call your new function, example, replace all <? wp_footer(); ?> calls with, you guested it, <? my_footer(); ?>

thanks to: http://www.raymondselda.com/understanding-action-hooks-in-wordpress/

Don’t forget to include the following in your new custom theme functions.php file if you want the dynamic custom drag widget sidebar!:

if ( function_exists(‘register_sidebar’) )
register_sidebar();

reference: http://codex.wordpress.org/Widgetizing_Themes

Moving WordPress DB changes and/or functions.php

Thursday, March 25th, 2010

change DB values

table:
wp-options

column:
option_name

fields:
siteurl
home

also to note in here:
blogname
upload_url_path
comment_moderation
rss_language
admin_email

ALTERNATE OPTION, (db inaccessible)
add a few lines to:
wp-content/themes/default/functions.php

lines:
update_option(‘siteurl’,’http://yourUrl‘);
update_option(‘home’,’http://yourUrl/soundstrue.com/podcast‘);

If the second option used not to be forgotten, as it will overwrite DB every time App loads…

WordPress Akismet (spam)

Monday, March 22nd, 2010

WordPress comes with the Akismet plugin.

Use it.

Reference: http://akismet.com/

How:

Create a dashboard.wordpress.com account  if you don’t already have one, & find your API key

then in your blog, activate the Akismet plugin, enter your key, reap the rewards.

This Blog proudly uses the following Widget Plugins

Thursday, March 18th, 2010

Google AdSense Widget

http://wordpress.smullindesign.com/plugins/google-adsense-widget

Google XML Sitemaps

http://www.arnebrachhold.de/redir/sitemap-home/

Simple Hit Counter

http://jungwirths.com/2009/03/simple-wordpress-hit-counter-plugin/

WP Simple Paypal Donation

http://www.tipsandtricks-hq.com/?page_id=942

Exec PHP

http://bluesome.net/post/2005/08/18/50/

Deactivate Visual Editor

http://plugindve.wordpress.com/

Google Analytics for WordPress

http://yoast.com/wordpress/analytics/#utm_source=wordpress&utm_medium=plugin&utm_campaign=google-analytics-for-wordpress

WordPress SESSIONS

Thursday, March 4th, 2010

simply add:

session_start();

to the start of:

wp-config.php

right at the top, after <?

If homepage : do a second “Loop” to show current article “post” WordPress

Thursday, March 4th, 2010

<? if(is_front_page()) : ?>
<? query_posts(‘showposts=1′); ?>
<?php while (have_posts()): the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php the_excerpt(); ?>
<p><a href=”<?php the_permalink(); ?>“>Read more…</a></p>
<?php endwhile; ?>
<? endif; ?>