<?php $attachment_link = get_the_attachment_link($post->ID, true, array(450, 800)); // This also populates the iconsize for the next line ?>
<?php $_post = &get_post($post->ID); $classname = ($_post->iconsize[0] <= 128 ? ‘small’ : ”) . ‘attachment’; // This lets us style narrow icons specially ?>
<div id=”post-<?php the_ID(); ?>”>
<h2><a href=”<?php echo get_permalink($post->post_parent); ?>” rev=”attachment”><?php echo get_the_title($post->post_parent); ?></a> » <a href=”<?php echo get_permalink() ?>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”>
<?php the_title(); ?>
</a></h2>
<div class=”entry”>
<p class=”<?php echo $classname; ?>”><?php echo $attachment_link; ?> <br />
<!–<?php echo basename($post->
guid); ?> –> </p>
<?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages:</strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
</div>
</div>
Custom Tags – adding class to paragraph and div in WordPress
kses.php file in wp-includes
# Web page: http://sourceforge.net/projects/kses
#
# [kses strips evil scripts!]
if (!defined(‘CUSTOM_TAGS’))
define(‘CUSTOM_TAGS’, false);
// You can override this in your my-hacks.php file
// added class to div and p iz
number of words in exceprt
/*
Plugin Name: Longer Excerpt
Plugin URI: http://miche.netsons.org/projects/longer-excerpt/
Description: This plugin allows you to choose how many words do you want to show in feeds, if you have set them to show only summaries of each post. Configure the desired number by editing this plugin: default in WP is 56, not much fair for readers; default in this plugin is 200. <a href=”http://miche.netsons.org/projects/longer-excerpt/”>More</a>…
Version: 0.1
Author: Andrea Micheloni
Author URI: http://miche.netsons.org/
License: CC BY-NC-SA
License URI: http://creativecommons.org/licenses/by-nc-sa/2.5/
*/
$tm_length=20;
//What do you want to put after the truncated entry?
//Default in WP normally is “[..]”
$tm_other='[…]’;
// *** END EDITING HERE, PLEASE 😀 ***
Good 404 error code
You
"); #email you about problem*/
$casemessage = "An administrator has been emailed
about this problem, too.";#set a friendly message
}
echo " ".$website.$_SERVER['REQUEST_URI']; ?>
and it doesn't exist. You can click back
and try again or search for what you're looking for:
WordPress image size max value
make change in php.ini file – cannot find this file for now 🙁
$type = getimagesize($file);
by otto – http://ottodestruct.com/, thanks to post in http://lorelle.wordpress.com/2007/03/28/wordpress-thumbnail-size-limit-hack/
function raise_image_size_limit() {
return 8*1024*1024; // or whatever you want
}
add_filter('wp_thumbnail_creation_size_limit','raise_image_size_limit');
function custom_thumbnail_size() {
return 128; // or whatever you want
}
add_filter('wp_thumbnail_max_side_length','custom_thumbnail_size');
Add Subscribe buttons
http://www.semiologic.com/software/subscribe-me/
http://poplarware.com/subscriptionplugin.html – icons
Getting data from postmeta table
<?php // the_meta();
global $wpdb;
// $thispostid = $post->ID;
$q = 'SELECT meta_value FROM '.$wpdb->postmeta.' WHERE post_id = '. $post->ID .' AND meta_key = 'Site URL' ' ;
$result = $wpdb->get_results("$q");
if ( $result[0]->meta_value != '') {
?>
<p><a href="<?php echo $result[0]->meta_value; ?>">view site online</a> </p>
<?php }?>
Login header code
<div id=”login” >
<p>
<?php
echo(‘Welcome to ‘);
global $user_identity;
if ( $user_identity != ”) {
echo( bloginfo(‘name’).’, ‘. $user_identity. ‘ | ‘ );
}
else { echo( bloginfo(‘name’).’, Guest | ‘ );}?>
<?php wp_loginout(); ?>
|
<?php wp_register(); ?>
</div>
Custom IMCE setting and allowing div in posts
from http://wordpress.org/support/topic/76086
Tiny MCE as configured in WordPress 2.1 wipes away divs and replaces them with p tags.
This can be fixed by doing the following:
1-Open your TinyMCE config file in an editor. The file is located at:
wp-includes/js/tinymce/plugins/tiny_mce_config.php
2-Replace Line 25 with the following but on a single line:
$valid_elements = ‘#p[*],-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]’;
3-Save the file back to your active WordPress installation, overwriting the existing tiny_mce_config.php file.
4-In WordPress admin, the editor will now allow divs.
You may have to refresh your editor page.
As always, copy your original tiny_mce_config.php file to a safe place for backup before editing the original.
Allowing divs
Tiny MCE as configured in WordPress 2.1 wipes away divs and replaces them with p tags.
This can be fixed by doing the following:
1-Open your TinyMCE config file in an editor. The file is located at:
wp-includes/js/tinymce/plugins/tiny_mce_config.php
2-Replace Line 25 with the following but on a single line:
$valid_elements = ‘#p[*],-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]’;
3-Save the file back to your active WordPress installation, overwriting the existing tiny_mce_config.php file.
4-In WordPress admin, the editor will now allow divs.
You may have to refresh your editor page.
As always, copy your original tiny_mce_config.php file to a safe place for backup before editing the original.
word press themes i like
100% width with right navigation http://www.alexking.org/software/wordpress/styles/sample.php?wpstyle=rubric
right nav with left image
http://www.alexking.org/software/wordpress/styles/sample.php?wpstyle=slinkycat&c=1#comments
left nav, 100% WIDTH
http://www.alexking.org/software/wordpress/styles/sample.php?wpstyle=emilysfolio
3 column, fixed width
http://www.alexking.org/software/wordpress/styles/sample.php?wpstyle=dots