• 04-07-2014, 19:33:21
    #1
    Şimdi widgette kullanmak üzere bi görsel hazırladım, aşağıdaki örnekte göründüğü gibi. Böyle bir kaç tane yazar olacak, ben bu görseli sabit tutucam, orada "Firavunlar bizi böyle aptallaştırdılar" kısmı ise o yazarın son yazısından gelicek. Bunu hangi kodla çekerim?

  • 04-07-2014, 19:38:32
    #2
    Böyle bir kod buldum, inşallah aradığındır.

    function get_related_author_posts() {
        global $authordata, $post;
        $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5 ) );
        $output = '<ul>';
        foreach ( $authors_posts as $authors_post ) {
            $output .= '<li><a href="' . get_permalink( $authors_post->ID ) . '">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a></li>';
        }
        $output .= '</ul>';
        return $output;
    }
    5 yazan yeri bir yaparsan tek yazısını gösterirmişsin.

    cok_asi55 adlı üyeden alıntı: mesajı görüntüle
    Şimdi widgette kullanmak üzere bi görsel hazırladım, aşağıdaki örnekte göründüğü gibi. Böyle bir kaç tane yazar olacak, ben bu görseli sabit tutucam, orada "Firavunlar bizi böyle aptallaştırdılar" kısmı ise o yazarın son yazısından gelicek. Bunu hangi kodla çekerim?

  • 05-07-2014, 00:01:33
    #3
    RainManTR adlı üyeden alıntı: mesajı görüntüle
    Böyle bir kod buldum, inşallah aradığındır.

    function get_related_author_posts() {
        global $authordata, $post;
        $authors_posts = get_posts( array( 'author' => $authordata->ID, 'post__not_in' => array( $post->ID ), 'posts_per_page' => 5 ) );
        $output = '<ul>';
        foreach ( $authors_posts as $authors_post ) {
            $output .= '<li><a href="' . get_permalink( $authors_post->ID ) . '">' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '</a></li>';
        }
        $output .= '</ul>';
        return $output;
    }
    5 yazan yeri bir yaparsan tek yazısını gösterirmişsin.

    Benzer bir kodda ben buldum, sağdan soldan sitelerden toplaya toplaya bu hale getirdim. Şimdi gravatarı oval yapmak kaldı. Bide hücrelerde çok kayma yapıyor. Yani tam uzmanı olmadığım için bu kadar yapabiliyorum. Normalde burada tablo kullanmadan yapabiliyoruz ama o konu hakkında hiç bilgim olmadığı için bende tablo üzerinden gittim.


    <div align="left">
                <h4 class="widget_title">YAZARLAR</h4>
    
       <table width="220px" height="101px" align="top" border="0" cellspacing="0" cellpadding="0" style="background:url(http://haberr.com/wp-content/themes/wpherald_lite/images/yazar-kutusu.jpg); background-repeat:no-repeat;">
          <tr>
          <td  height="75px" width="120px" margin-left="0px" margin-top="0px">
            <div style="margin-left:10px; margin-top:5px; width:110px;"><font size="2px;" face="arial narrow" color="#000000">
    <?php query_posts('orderby=date&showposts=1&author=1'); ?> 
    <? while (have_posts()) : the_post(); ?> 
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
    <?php the_title(); ?></a> 
    <? echo '<br />'; ?> 
    <? endwhile; ?>
    </font></div>
    </td>
    <td height="101px" width="100px" rowspan="2" align="center">
    <?php echo get_avatar( get_the_author_email(), '89' ); ?>
    </td>
    </tr>
    <tr>
    <td height="27px" width="120px" margin-left="0px" margin-top="0px">
            <div style="margin-left:10px; margin-bottom:-1px;"><font size="4px;" font-family="arial" color="#e0e4ec">İsa Koç</font></div>
    
          </td></tr><br />
        </table>
    </div>
    <div class="clear"></div>
    Sonu aşağıdaki gibi oldu.


    örnek site: http://haberr.com/

    orta kolonun altında doğru inin görüceksiniz.
  • 05-07-2014, 00:02:55
    #4
    cok_asi55 adlı üyeden alıntı: mesajı görüntüle
    Benzer bir kodda ben buldum, sağdan soldan sitelerden toplaya toplaya bu hale getirdim. Şimdi gravatarı oval yapmak kaldı. Bide hücrelerde çok kayma yapıyor. Yani tam uzmanı olmadığım için bu kadar yapabiliyorum. Normalde burada tablo kullanmadan yapabiliyoruz ama o konu hakkında hiç bilgim olmadığı için bende tablo üzerinden gittim.


    <div align="left">
                <h4 class="widget_title">YAZARLAR</h4>
    
       <table width="220px" height="101px" align="top" border="0" cellspacing="0" cellpadding="0" style="background:url(http://haberr.com/wp-content/themes/wpherald_lite/images/yazar-kutusu.jpg); background-repeat:no-repeat;">
          <tr>
          <td  height="75px" width="120px" margin-left="0px" margin-top="0px">
            <div style="margin-left:10px; margin-top:5px; width:110px;"><font size="2px;" face="arial narrow" color="#000000">
    <?php query_posts('orderby=date&showposts=1&author=1'); ?> 
    <? while (have_posts()) : the_post(); ?> 
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
    <?php the_title(); ?></a> 
    <? echo '<br />'; ?> 
    <? endwhile; ?>
    </font></div>
    </td>
    <td height="101px" width="100px" rowspan="2" align="center">
    <?php echo get_avatar( get_the_author_email(), '89' ); ?>
    </td>
    </tr>
    <tr>
    <td height="27px" width="120px" margin-left="0px" margin-top="0px">
            <div style="margin-left:10px; margin-bottom:-1px;"><font size="4px;" font-family="arial" color="#e0e4ec">İsa Koç</font></div>
    
          </td></tr><br />
        </table>
    </div>
    <div class="clear"></div>
    Sonu aşağıdaki gibi oldu.


    örnek site: http://haberr.com/

    orta kolonun altında doğru inin görüceksiniz.
    oval yapmak için border-radius kullanın.
  • 05-07-2014, 00:03:31
    #5
    cok_asi55 adlı üyeden alıntı: mesajı görüntüle
    Benzer bir kodda ben buldum, sağdan soldan sitelerden toplaya toplaya bu hale getirdim. Şimdi gravatarı oval yapmak kaldı. Bide hücrelerde çok kayma yapıyor. Yani tam uzmanı olmadığım için bu kadar yapabiliyorum. Normalde burada tablo kullanmadan yapabiliyoruz ama o konu hakkında hiç bilgim olmadığı için bende tablo üzerinden gittim.


    <div align="left">
                <h4 class="widget_title">YAZARLAR</h4>
    
       <table width="220px" height="101px" align="top" border="0" cellspacing="0" cellpadding="0" style="background:url(http://haberr.com/wp-content/themes/wpherald_lite/images/yazar-kutusu.jpg); background-repeat:no-repeat;">
          <tr>
          <td  height="75px" width="120px" margin-left="0px" margin-top="0px">
            <div style="margin-left:10px; margin-top:5px; width:110px;"><font size="2px;" face="arial narrow" color="#000000">
    <?php query_posts('orderby=date&showposts=1&author=1'); ?> 
    <? while (have_posts()) : the_post(); ?> 
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
    <?php the_title(); ?></a> 
    <? echo '<br />'; ?> 
    <? endwhile; ?>
    </font></div>
    </td>
    <td height="101px" width="100px" rowspan="2" align="center">
    <?php echo get_avatar( get_the_author_email(), '89' ); ?>
    </td>
    </tr>
    <tr>
    <td height="27px" width="120px" margin-left="0px" margin-top="0px">
            <div style="margin-left:10px; margin-bottom:-1px;"><font size="4px;" font-family="arial" color="#e0e4ec">İsa Koç</font></div>
    
          </td></tr><br />
        </table>
    </div>
    <div class="clear"></div>
    Sonu aşağıdaki gibi oldu.


    örnek site: http://haberr.com/

    orta kolonun altında doğru inin görüceksiniz.
    profil resmini ovalleştirmek için Css3: Border Radius konusuna bakmanız gerekmekte heralde...
  • 05-07-2014, 00:04:57
    #6
    @cok_asi55; site bilgilerini ver yapayım ?
  • 05-07-2014, 00:05:03
    #7
    truser adlı üyeden alıntı: mesajı görüntüle
    oval yapmak için border-radius kullanın.
    6 saniye ile hocam valla anlayamadım gitti

    6 saniyede yazamam sizden görüp aynı cevabı verdim bende araştırıp
  • 05-07-2014, 00:06:50
    #8
    RainManTR adlı üyeden alıntı: mesajı görüntüle
    6 saniye ile hocam valla anlayamadım gitti

    6 saniyede yazamam sizden görüp aynı cevabı verdim bende araştırıp
    Sivil Hayatta Karşıma Çıkma