• 12-12-2013, 14:34:41
    #1
     <?php
     $custom_field = get_post_meta($post->ID, "secim", $single = true);
    	if($custom_field !== '')
     {
    echo'
    <div class="arsiv">
    		<a href="<?php the_field('pdf'); ?>" target="_blank"><img src="<?php the_field('resim'); ?>"/></a>
    			<a href="<?php the_field('pdf'); ?>" target="_blank"><h2><?php the_title(); ?></h2></a>
    			<p><?php echo kisalt($post->post_content, 150); ?>...</p>
    
                    <a href="<?php the_field('pdf'); ?>" target="_blank" class="pdf">PDF</a>
    		<a href="<?php the_field('solidworks'); ?>" target="_blank" class="solidworks">Solid</a>
    		</div>';
     }
    else
    {
    echo'
    <div class="arsiv">
    		<a href="<?php the_field('pdf'); ?>" target="_blank"><img src="<?php the_field('resim'); ?>"/></a>
    			<a href="<?php the_field('pdf'); ?>" target="_blank"><h2><?php the_title(); ?></h2></a>
    			<p><?php echo kisalt($post->post_content, 150); ?>...</p>
    		</div>';
    } 
    ?>

    Bu tırnaklara ilgli sorun yaşıyorum ne yapmam gerekiyor
  • 12-12-2013, 14:48:53
    #2
    Echo icinde <?php taglarini kullanamazsin buyur düzenledim.

    $custom_field = get_post_meta($post->ID, "secim", $single = true);
       if(isset($custom_field)){
    echo'
    <div class="arsiv">
          <a href="'.the_field('pdf').'" target="_blank"><img src="'.the_field('resim').'"/></a>
             <a href="'.the_field('pdf').'" target="_blank"><h2>'.the_title().'</h2></a>
             <p>'.kisalt($post->post_content, 150).'...</p>
     
                    <a href="'.the_field('pdf').'" target="_blank" class="pdf">PDF</a>
          <a href="'.the_field('solidworks').'" target="_blank" class="solidworks">Solid</a>
          </div>';
    }else{
    echo'
    <div class="arsiv">
          <a href="'.the_field('pdf').'" target="_blank"><img src="'.the_field('resim').'"/></a>
             <a href="'.the_field('pdf').'" target="_blank"><h2>'.the_title().'</h2></a>
             <p>'.kisalt($post->post_content, 150).'</p>
          </div>';
    }