Bantuan » Serbaneka » mohon bantuan script

  • Saya bikin script, rencananya scrip ini adalah script untuk membuat kolom

    seperti ini.

    namun kok hasilnya seperti ini yah

    ini scriptnya :

    “”<?php
    $cats = Array(42,5,93,23);

    echo ‘<div style=”width:600px”>’;
    foreach($cats as $cat) {

    $querycat = new WP_Query(‘cat=’.$cat.’&showposts=1′);
    if ($querycat->have_posts()) :
    echo ‘<div class=”kolomcat” style=”width:140px; margin-right:5px;float:left”>’;
    echo ‘<h2>‘.get_cat_name($cat).’</h2>’;
    while ($querycat->have_posts()) : $querycat->the_post();?>
    <h3>” title=”<?php the_title_attribute();?>”><?php the_title();?></h3>
    <?php echo ‘<p>’.substr(get_the_content(), 0,200).'</p>’; ?>
    <?php endwhile;
    echo ‘</div>’;
    endif;
    }
    echo ‘<div style=”clear:left”></div>’;
    echo ‘</div>’;
    ?>””
    (tanpa tanda petik)scriptnya di masukkan di home.php

    mohon pencerahannya… terima kasih

Melihat 8 balasan - 1 sampai 8 (dari total 8)
  • sepertinya shortcode [caption] anda tidak muncul, tapi maaf saya tidak tahu kenapa. 🙂

    Pencetus Utas togogsemar

    (@togogsemar)

    script nya udah saya rubah…

    namun gambarnya tidak muncul… screenshootnya

    ada yang tahu bagaimana supaya bisa memunculkan gambarnya….

    “”<?php
    $cats = Array(42,5,93,23);

    echo ‘<div style=”width:600px”>’;
    foreach($cats as $cat) {

    $querycat = new WP_Query(‘cat=’.$cat.’&showposts=1′);
    if ($querycat->have_posts()) :
    echo ‘<div class=”kolomcat” style=”width:140px; margin-right:5px;float:left”>’;
    echo ‘<h2>‘.get_cat_name($cat).’</h2>’;
    while ($querycat->have_posts()) : $querycat->the_post();?>
    <h3>” title=”<?php the_title_attribute();?>”><?php the_title();?></h3>
    <?php the_excerpt();?>
    <?php endwhile;
    echo ‘</div>’;
    endif;
    }
    echo ‘<div style=”clear:left”></div>’;
    echo ‘</div>’;
    ?> “”

    (tanpa tanda petik)scriptnya di masukkan di home.php

    mohon pencerahannya

    Pencetus Utas togogsemar

    (@togogsemar)

    css buat margin…….

    “”.kolomcat h2 a {
    display:block; /*supaya ‘a’ bisa dikasih margin*/
    font-size:150%; /* tentukan besarnya font, sesuai selera */
    margin-bottom:10px /* tentukan margin bawahnya, sesuai selera */
    }””

    (tanpa tanda petik)scriptnya di masukkan di style.css

    Pencetus Utas togogsemar

    (@togogsemar)

    belum resolved deng…. heheheh

    saya belum menemukan script yang bisa memunculkan gambar

    ini scriptnya

    “”<?php
    $cats = Array(42,5,93,23);

    echo ‘<div style=”width:600px”>’;
    foreach($cats as $cat) {

    $querycat = new WP_Query(‘cat=’.$cat.’&showposts=1′);
    if ($querycat->have_posts()) :
    echo ‘<div class=”kolomcat” style=”width:140px; margin-right:5px;float:left”>’;
    echo ‘<h2>’.get_cat_name($cat).'</h2>’;
    while ($querycat->have_posts()) : $querycat->the_post();?>
    <h3>” title=”<?php the_title_attribute();?>”><?php the_title();?></h3>
    <?php the_excerpt();?>
    <?php endwhile;
    echo ‘</div>’;
    endif;
    }
    echo ‘<div style=”clear:left”></div>’;
    echo ‘</div>’;
    ?> “”

    (tanpa tanda petik)scriptnya di masukkan di home.php

    Saya tidak terlalu memahami script PHP anda, tapi mungkin anda bisa menggunakan salah satu tag baru WordPress. Mulai versi 2.9 anda bisa menggunakan get the post thumbnail() untuk menampilkan post thumbnail yang telah anda tentukan sebelumnya.

    Pencetus Utas togogsemar

    (@togogsemar)

    get the post thumbnail itu semacam plugin atau widget???

    get the post thumbnail() adalah function bawaan WordPress mulai versi 2.9. Tinggal tambahkan dukungan post thumbnail pada theme anda lalu sisipkan function tersebut dalam loop-nya. (Contoh)

    berarti pada themenya ya. Bisnis Syariah
    uang

Melihat 8 balasan - 1 sampai 8 (dari total 8)
  • Topik ‘mohon bantuan script’ tertutup untuk balasan baru.