• 22-10-2012, 15:32:54
    #1
    Merhaba arkadaşlar aşağıdaki kodlarda bir hata var sanırsam

    Parse error: syntax error, unexpected '<' in /home/troto/domains/tr-otomobil.com/public_html/wp-content/themes/magazine_10/functions.php on line 44

    hatası alıyorum. Düzeltemedim.. Yardımcı olursanız sevinirim...

    <?php
    
    // Uncomment this to test your localization, make sure to enter the right language code.
    // function test_localization( $locale ) {
    // 	return "nl_NL";
    // }
    // add_filter('locale','test_localization');
    
    load_theme_textdomain('studiopress', TEMPLATEPATH.'/languages/');
    
    add_filter('comments_template', 'legacy_comments');
    
    function legacy_comments($file) {
    
    	if(!function_exists('wp_list_comments')) : // WP 2.7-only check
    		$file = TEMPLATEPATH . '/legacy.comments.php';
    	endif;
    
    	return $file;
    }
    
    // Turn a category ID to a Name
    function cat_id_to_name($id) {
    	foreach((array)(get_categories()) as $category) {
        	if ($id == $category->cat_ID) { return $category->cat_name; break; }
    	}
    }
    
    // Load the scripts
    if(get_theme_mod('subnav') == 'Yes') { 
    	wp_enqueue_script('subnav', get_bloginfo('template_url').'/js/subnav.js','','1.0',true);
    } else { 
    	wp_enqueue_script('nav', get_bloginfo('template_url').'/js/nav.js','','1.0',true);
    }
    if(get_theme_mod('tabber') == 'Yes') { 
    	wp_enqueue_script('tabber', get_bloginfo('template_url').'/js/tabber.js','','1.0',true);
    }
    
    // include the breadcrumb nav tool
    include(TEMPLATEPATH."/tools/breadcrumbs.php");
    
    // thumbnail
    function bm_extract_string($start, $end, $original) {
    $original = stristr($original, $start);		<?php while (have_posts()) : the_post(); ?>
    $trimmed = stristr($original, $end);
    return substr($original, strlen($start), -strlen($trimmed));
    }
    function getFirstImage() {
    $content = get_the_content();
    $pic_string = bm_extract_string('src="','" ',$content');
    echo $pic_string;
    }
    
    if ( function_exists('register_sidebars') )
    	register_sidebar(array('name'=>'Sidebar Right','before_title'=>'<h4>','after_title'=>'</h4>'));
    if ( function_exists('register_sidebars') )
    	register_sidebar(array('name'=>'Yan yana widget\'lar','before_widget'=>'','after_widget'=>'</li>','before_title'=>'<li class="widget widget2"><h4>','after_title'=>'</h4>'));
    
    function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
        $content = get_the_content($more_link_text, $stripteaser, $more_file);
        $content = apply_filters('the_content', $content);
        $content = str_replace(']]>', ']]&gt;', $content);
        $content = strip_tags($content);
    
       if (strlen($_GET['p']) > 0) {
          echo "<p>";
          echo $content;
    		if ($more_link_text != '') {
    	      echo "&nbsp;<a rel='nofollow' href='";
    	      the_permalink();
    	      echo "'>".__('Read More', 'studiopress')." &rarr;</a>";
    		}
          echo "</p>";
       }
       else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
            $content = substr($content, 0, $espacio);
            $content = $content;
            echo "<p>";
            echo $content;
            echo "...";
    		if ($more_link_text != '') {
            	echo "&nbsp;<a rel='nofollow' href='";
            	the_permalink();
            	echo "'>".$more_link_text."</a>";
    		}
            echo "</p>";
       }
       else {
          echo "<p>";
          echo $content;
    		if ($more_link_text != '') {
    	      echo "&nbsp;<a rel='nofollow' href='";
    	      the_permalink();
    	      echo "'>".__('Read More', 'studiopress')." &rarr;</a>";			
    		}
          echo "</p>";
       }
    }
    
    function sp_widget() {
        require_once(ABSPATH.WPINC.'/rss.php'); 
        if ( $rss = fetch_rss( 'http://feeds2.feedburner.com/studiopress' ) ) {
            $content = '<div class="rss-widget>"';
            $content .= '<p style="border-bottom: 1px solid #ccc; padding-bottom: 10px; font-weight: bold;"><a rel="nofollow" href="http://www.studiopress.com/themes/pro-plus">Upgrade now to the Pro Plus All-Theme package for only $140 --></a <br /> <small>(Use PPUPG as the discount code when you are on the shopping cart page.)</small></p>';
            $content .= '<ul>';
            foreach ( array_slice( $rss->items, 0, 5 ) as $item ) {
                $content .= '<li>';
                $content .= '<a class="rsswidget" href="'.esc_url( $item['link'] ).'">'.htmlentities( $item['title'] ).'</a>';
                $content .= ' <span class="rss-date">'.date('F j, Y',strtotime($item['published'])).'</span>';
                $content .= '<div class="rssSummary">'.htmlentities( $item['summary'] ).'</div>';
                $content .= '</li>';
            }
            $content .= '</ul>';
    		$content .= '<p style="border-top: 1px solid #ccc; padding-top: 10px; font-weight: bold;"><a target="_blank" href="http://feeds2.feedburner.com/studiopress"><img style="vertical-align:middle;margin:0px 3px 3px 0px;" src="http://www.studiopress.com/images/rss.png" alt="Subscribe to StudioPress" /></a><a target="_blank" href="http://feeds2.feedburner.com/studiopress">Subscribe to RSS</a><a target="_blank" href="http://feedburner.google.com/fb/a/mailverify?uri=studiopress"></a>&nbsp;&nbsp;<img style="vertical-align:middle;margin:0px 3px 3px 0px;" src="http://www.studiopress.com/images/rss.png" alt="Subscribe to StudioPress" /></a><a target="_blank" href="http://feedburner.google.com/fb/a/mailverify?uri=studiopress">Subscribe via Email</a></p>';
            $content .= '</div>';
            echo $content;
        }
    }
     
    function sp_widget_setup() {
        wp_add_dashboard_widget( 'sp_db_widget' , 'The Latest News From StudioPress' , 'sp_widget');
    }
     
    add_action('wp_dashboard_setup', 'sp_widget_setup');  
    
    // Remove WP Generator for security reasons
    remove_action('wp_head', 'wp_generator');
    ?>
  • 22-10-2012, 16:52:03
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
     
    // thumbnail
    function bm_extract_string($start, $end, $original) {
    $original = stristr($original, $start);		<?php while (have_posts()) : the_post(); ?>
    $trimmed = stristr($original, $end);
    return substr($original, strlen($start), -strlen($trimmed));
    }

    burasi asagidaki sekilde olacak

         
    // thumbnail
    function bm_extract_string($start, $end, $original) {
    $original = stristr($original, $start);
    $trimmed = stristr($original, $end);
    return substr($original, strlen($start), -strlen($trimmed));
    }



    <?php while (have_posts()) : the_post(); ?>

    bunu kaldir ordan yanlislikla paste yapmissin sanirim.
  • 22-10-2012, 18:41:57
    #3
    Evet hocam onu farkettim sildim.. Şimdi de şu hatayı verdi

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/troto/domains/tr-otomobil.com/public_html/wp-content/themes/magazine_10/functions.php on line 54
  • 22-10-2012, 22:17:04
    #4
    bunu sanayiye götürün en iyisi çok karışmış:

    https://www.google.com.tr/search?q=k...ient=firefox-a