I'm a bit of a novice when it comes to .php. I have no idea what the error is, I can't seem to find the missing ' or ; on line 18. Here is the error I get:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/youngnae/youngnae.com/wp-content/themes/picture-perfect/functions.php on line 18
And here is the entire code for that file:
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'sidebar1',
));
register_sidebar(array('name'=>'sidebar2',
));
function slider_menuparse($input) {
$output = preg_replace("'page-item-\d+'", 'page-item-11', $input, -1, $count);
$number = 0;
if ($count < 4)
echo '<!-- THESE AR ETHE LINKS YOU GO TO WHEN YOU CLICK ON A SLIDING DOOR IMAGE-->
<!-- THESE AR ETHE LINKS YOU GO TO WHEN YOU CLICK ON A SLIDING DOOR IMAGE-->
<!-- change the href to look like this: <a href="yourlink.com"> -->
<li class="bk1"><a href="http://youngnae.com/?cat=8" <?php bloginfo('url'); ?>/?cat=1">Category 1</a></li>
<li class="bk2"><a href="http://youngnae.com/?cat=13" <?php bloginfo('url'); ?>/?cat=2">Category 2</a></li>
<li class="bk3"><a href="http://youngnae.com/?cat=16" <?php bloginfo('url'); ?>/?cat=3">Category 3</a></li>
<li class="bk4"><a href="http://youngnae.com/?cat=17" <?php bloginfo('url'); ?>/?cat=4">Category 4</a></li>
<li class="bk5"><a href="http://youngnae.com/?cat=19" <?php bloginfo('url'); ?>/?cat=5">Category 5</a></li>
<li class="bk6"><a href="http://youngnae.com/?cat=20" <?php bloginfo('url'); ?>/?cat=6">Category 6</a></li>
<li class="bk7"><a href="http://youngnae.com/?cat=21" <?php bloginfo('url'); ?>/?cat=7">Category 7</a></li>
else {
for ( $counter = $count+1; $counter <= 7; $counter += 1) {
$output = $output.'<li class="page_item bk'.($counter).'"><a href="" title=""></a></li>';
}
for ( $counter = 1; $counter <= $count; $counter += 1) {
$output = preg_replace("'page-item-11'", 'bk'.sprintf($counter,u), $output, 1, $count2);
}
echo $output;
}
}
/*
The followign is the page links to plugin incorportated into this theme.
Plugin URI: http://txfx.net/code/wordpress/page-links-to/
Version: 1.5
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
/* Copyright 2005-2008 Mark Jaquith (email: mark.gpl@txfx.net)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
function txfx_get_page_links_to_meta () {
global $wpdb, $page_links_to_cache;
if ( !isset( $page_links_to_cache ) ) {
$links_to = $wpdb->get_results(
"SELECT post_id, meta_value " .
"FROM $wpdb->postmeta, $wpdb->posts " .
"WHERE post_id = ID AND meta_key = 'links_to' AND (post_status = 'static' OR post_status = 'publish')");
} else {
return $page_links_to_cache;
}
if ( !$links_to ) {
$page_links_to_cache = false;
return false;
}
foreach ( (array) $links_to as $link ) {
$page_links_to_cache[$link->post_id] = $link->meta_value;
}
return $page_links_to_cache;
}
function txfx_get_page_links_to_targets () {
global $wpdb, $page_links_to_target_cache;
if ( !isset( $page_links_to_target_cache ) ) {
$links_to = $wpdb->get_results(
"SELECT post_id, meta_value " .
"FROM $wpdb->postmeta, $wpdb->posts " .
"WHERE post_id = ID AND meta_key = 'links_to_target' AND (post_status = 'static' OR post_status = 'publish')");
} else {
return $page_links_to_target_cache;
}
if ( !$links_to ) {
$page_links_to_target_cache = false;
return false;
}
foreach ( (array) $links_to as $link ) {
$page_links_to_target_cache[$link->post_id] = $link->meta_value;
}
return $page_links_to_target_cache;
}
function txfx_plt_add_meta_box( $page, $context ) {
if ( ( 'page' === $page || 'post' === $page ) && 'advanced' === $context )
add_meta_box('page-links-to', 'Page Links To', 'txfx_plt_meta_box', $page, 'advanced', 'low');
}
function txfx_plt_meta_box() {
global $post;
if ( get_post_meta( $post->ID, 'links_to', true) )
echo '<p>';
wp_nonce_field( 'txfx_plt', '_txfx_pl2_nonce', false, true );
echo '</p>';
?>
Point to this URL: <input name="txfx_links_to" type="text" size="65" id="txfx_links_to" value="<?php echo attribute_escape( get_post_meta( $post->ID, 'links_to', true) ); ?>" />
<?php
}
function txfx_plt_save_meta_box( $post_ID ) {
if ( wp_verify_nonce( $_REQUEST['_txfx_pl2_nonce'], 'txfx_plt' ) && isset( $_POST['txfx_links_to'] ) && strlen( $_POST['txfx_links_to'] ) > 7 )
update_post_meta( $post_ID, 'links_to', $_POST['txfx_links_to'] );
return $post_ID;
}
function txfx_filter_links_to_pages ($link, $post) {
$page_links_to_cache = txfx_get_page_links_to_meta();
// Really strange, but page_link gives us an ID and post_link gives us a post object
$id = ($post->ID) ? $post->ID : $post;
if ( $page_links_to_cache[$id] )
$link = $page_links_to_cache[$id];
return $link;
}
function txfx_redirect_links_to_pages() {
if ( !is_single() && !is_page() )
return;
global $wp_query;
$link = get_post_meta( $wp_query->post->ID, 'links_to', true );
if ( !$link )
return;
$redirect_type = get_post_meta( $wp_query->post->ID, 'links_to_type', true );
if ( $redirect_type && $redirect_type != '302' ) {
// Only supporting 301 and 302 for now.
// The others aren't widely supported or needed anyway
header( "HTTP/1.0 301 Moved Permanently" );
header( "Status: 301 Moved Permanently" );
header( "Location: $link" );
exit;
}
// If we got this far, it's a 302 redirect
header( "Status: 302 Moved Temporarily" );
wp_redirect( $link );
exit;
}
function txfx_page_links_to_highlight_tabs( $pages ) {
$page_links_to_cache = txfx_get_page_links_to_meta();
$page_links_to_target_cache = txfx_get_page_links_to_targets();
if ( !$page_links_to_cache && !$page_links_to_target_cache )
return $pages;
$this_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$targets = array();
foreach ( (array) $page_links_to_cache as $id => $page ) {
if ( $page_links_to_target_cache[$id] )
$targets[$page] = $page_links_to_target_cache[$id];
if ( str_replace( 'http://www.', 'http://', $this_url ) == str_replace( 'http://www.', 'http://', $page ) || ( is_home() && str_replace( 'http://www.', 'http://', trailingsla****( get_bloginfo( 'home' ) ) ) == str_replace( 'http://www.', 'http://', trailingsla****( $page ) ) ) ) {
$highlight = true;
$current_page = $page;
}
}
if ( count( $targets ) ) {
foreach ( $targets as $p => $t ) {
$pages = str_replace( '<a href="' . $p . '" ', '<a href="' . $p . '" target="' . $t . '" ', $pages );
}
}
if ( $highlight ) {
$pages = str_replace( ' class="page_item current_page_item"', ' class="page_item"', $pages );
$pages = str_replace( '<li class="page_item"><a href="' . $current_page . '"', '<li class="page_item current_page_item"><a href="' . $current_page . '"', $pages );
}
return $pages;
}
add_filter( 'wp_list_pages', 'txfx_page_links_to_highlight_tabs' );
add_action( 'template_redirect', 'txfx_redirect_links_to_pages' );
add_filter( 'page_link', 'txfx_filter_links_to_pages', 20, 2 );
add_filter( 'post_link', 'txfx_filter_links_to_pages', 20, 2 );
add_action( 'do_meta_boxes', 'txfx_plt_add_meta_box', 10, 2 );
add_action( 'save_post', 'txfx_plt_save_meta_box' );
?>