Thanks Mark for the explanation of how it's working. I wonder if there's a way to solve the problem I presented...? Can I get the funtion to work calling a page with a title of more than one word which means there's a space in it, by modifying that code? I've included the function from the theme functions.php below.
thanks
JSC
function _get_page_by_name($page_name, $output = OBJECT) {
global $wpdb;
$page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_name = %s AND post_type='page'", $page_name ));
if ( $page )
return get_page($page, $output);
return null;
}
function _get_project_info( $what, $info ) {
$info = explode('<!--more-->', $info);
if( $what == 'image' )
return $info[0];
if( $what == 'small_image' ) {
$image_formats = array('.jpg"', '.png"', '.gif"');
$small_image = '';
foreach($image_formats as $image_format) {
if(strstr($info[0], $image_format)) {
$small_image = str_replace($image_format, '170x130' . $image_format, $info[0]);
break;
}
}
return $small_image;
}
if( $what == 'short_info' )
return $info[1];
if( $what == 'long_info' )
return $info[2];
return '';
}
and
function _get_short_info( $text ){
$t = explode('<!--more-->', $text);
return $t[0];
}