1. Halo Guest, pastikan Anda selalu menaati peraturan forum sebelum mengirimkan post atau thread baru.

Tidak Bisa Login di Wordpress - Layar putih setelah login

Discussion in 'Pemrograman Web' started by lagubaru, Jun 14, 2011.

  1. lagubaru

    lagubaru Ads.id Fan

    Joined:
    Mar 14, 2011
    Messages:
    108
    Likes Received:
    0
    Location:
    Cilacap
    Awalnya saya nemu kode kaya gini

    <?php // retreives image from the post
    function getImage($num) {
    global $more;
    $more = 1;
    $content = get_the_content();
    $count = substr_count($content, '<img');
    $start = 0;
    for($i=1;$i<=$count;$i++) {
    $imgBeg = strpos($content, '<img', $start);
    $post = substr($content, $imgBeg);
    $imgEnd = strpos($post, '>');
    $postOutput = substr($post, 0, $imgEnd+1);
    $image[$i] = $postOutput;
    $start=$imgEnd+1;
    $cleanF = strpos($image[$num],'src="')+5;
    $cleanB = strpos($image[$num],'"',$cleanF)-$cleanF;
    $imgThumb = substr($image[$num],$cleanF,$cleanB);
    }
    if(stristr($image[$num],'<img')) { echo $imgThumb; }
    $more = 0;
    }
    //retreive image ends
    ?>

    saya tambahkan di functions.php

    Terus kode
    <img src="<?php getImage('1'); ?>"
    height="100" width="120"
    style="DISPLAY: inline; margin: 0px 7px 0px 0px;
    FLOAT: left"/>
    <?php the_excerpt((__( '&raquo; Read more: ', 'default'))
    . the_title('', '',false)); ?>

    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php
    the_title();?>"><b>Baca Selengkapnya&gt;&gt;&gt;&gt;&gt;&gt;</b></a>

    saya tambahkan di index.php
    read more nya sih jadi di blog ane juga masih normal bisa dikunjungi tapi kenapa yah tidak bisa login kalau log in terus warna putih gitu, buat agan yang baik hati solusinya bagaimana nih????
     
  2. Blogger Bodoh

    Blogger Bodoh Ads.id Pro

    Joined:
    Apr 23, 2011
    Messages:
    456
    Likes Received:
    36
    Location:
    Pangkajene Kepulauan Sul-Sel
    Hapus aja kode yang baru di tambahkan, (sekedar nebak ..!!!)

    tunggu jawaban mastah di sini dah, mungkin di bawah w lebih tau ..
     
  3. moh.taqiem

    moh.taqiem Ads.id Fan

    Joined:
    Mar 23, 2011
    Messages:
    148
    Likes Received:
    5
    Location:
    Kamar Gelap
    Ini fungsi unk menambahkan image di post ya.. pake yang lebih sederhana aja bos..

    Tambahkan di functions.php

    PHP:
    add_theme_support'post-thumbnails' );
    add_filter'post_thumbnail_size''my_post_image_size' );

    function 
    my_post_image_size$size ) {
        
    $size = array(
            
    '100'//Image width
            
    '100'//Image height
            
    'true' //Croping image ?
        
    );
        return 
    $size;
    }
    kemudian tambahkan ini di index.php

    PHP:
    <div class="entry">
                    <div class="thumbnail">
                    <?php
                        
    if ( has_post_thumbnail() )
                            
    the_post_thumbnail'thumbnail' );
                        else
                        echo 
    "<img src='http://w3.produknya.web.id/wp-content/themes/w3/images/no-image.jpg' alt='' title='Tidak ada gambar' />";
                    
    ?>
                    </div>
                    <?php the_excerpt_feature(); ?>
            
                    </div>
    untuk css thumbnailnya ente bisa tambah spt ini :

    PHP:
    .thumbnail {
        
    background#fff url('images/no-image.jpg') repeat scroll 0 0;
        
    border1px solid #DDDDDD;
        
    floatleft;
        
    margin2px 10px 15px 0;
        
    padding2px;
        
    height100px;
        
    width:100px;
    }
    ente bisa liat demonya di hxxp://w3.produknya.web.id/
    selebihnya ente modifikasi aja...
     
  4. alhafizhi

    alhafizhi Super Hero

    Joined:
    Feb 3, 2011
    Messages:
    1,276
    Likes Received:
    198
    Location:
    Banjarmasin
    masalah di function.php nya tuh gan, coba hpus dlu kode yg bru dtmbahkan d function.php nya
     
  5. lagubaru

    lagubaru Ads.id Fan

    Joined:
    Mar 14, 2011
    Messages:
    108
    Likes Received:
    0
    Location:
    Cilacap
    Udah normal lagi gan setelah rename functions.php dan upload ulang functions.php. hari gini saya masih belajar buat read more, padahal temen-temen disini udah pada sampai ke modif autoblog aduh ketinggalan jauh nih saya
     
  6. far3dz

    far3dz Newbie

    Joined:
    Mar 9, 2011
    Messages:
    20
    Likes Received:
    1
    pastikan ga ada ruang selepas tutup ?> di dalam functions.php ya :)
     
    lagubaru likes this.
  7. lagubaru

    lagubaru Ads.id Fan

    Joined:
    Mar 14, 2011
    Messages:
    108
    Likes Received:
    0
    Location:
    Cilacap
    function.php theme yang saya gunakan

    <?php
    /**
    * Functions - Framework gatekeeper
    *
    * This file defines a few constants variables, loads up the core framework file,
    * and finally initialises the main WP Framework Class.
    *
    * @package RedLine
    * @subpackage Functions
    */

    // The height and width of your custom header
    define( 'HEADER_IMAGE_HEIGHT', 85 );
    define( 'HEADER_IMAGE_WIDTH', 960 );
    define( 'HEADER_TEXTCOLOR', 'FFFFFF' );
    define( 'HEADER_IMAGE', '%s/library/media/images/header.jpg' );

    if ( ! isset( $content_width ) ) $content_width = 515; // set the global width of the media content

    set_post_thumbnail_size( 140, 140 ); // 140 pixels wide by 140 pixels tall, box resize mode

    load_theme_textdomain( 'redline' , TEMPLATEPATH . '/lang' ); // load localization files

    add_editor_style();

    /* Blast you red baron! Initialise WP Framework */

    require_once( TEMPLATEPATH . '/library/framework.php' );
    WPFramework::init();

    ?>


    index.php bog saya

    <?php
    /**
    * Template: Index.php
    *
    * @package RedLine
    * @subpackage Template
    */
    get_header();
    ?>
    <!--BEGIN #primary .hfeed-->
    <div id="primary" class="hfeed" role="main">
    <?php if ( have_posts() ) : ?>
    <?php while ( have_posts() ) : the_post(); ?>

    <!--BEGIN .hentry-->
    <article id="post-<?php the_ID(); ?>"><div class="<?php semantic_entries(); ?>">
    <header class="post-title"><h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e( 'Permanent Link to' ,'redline' );?> <?php the_title(); ?>"><?php the_title(); ?></a></h2></header>

    <!--BEGIN .entry-meta .entry-header-->
    <section class="meta-header"><div class="entry-meta entry-header">
    <span class="published"> <abbr class="published-time" title="<?php the_time( get_option( 'date_format' ) .' - '. get_option( 'time_format' ) ); ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span> | <?php _e( 'Author:', 'redline' );?>
    <span class="author vcard"> <?php printf( '<a class="url fn" href="' . get_author_posts_url( $authordata->ID, $authordata->user_nicename ) . '" title="' . sprintf( __( 'View all posts by %s', 'redline' ), $authordata->display_name ) . '">' . get_the_author() . '</a>' ) ?></span>
    <?php edit_post_link( __( 'edit', 'redline' ), '<span class="edit-post">[', ']</span>' ); ?>
    </div></section><!--END .entry-meta .entry-header-->

    <!--BEGIN .entry-content-->
    <div class="entry-content">
    <?php the_post_thumbnail(); ?><?php the_content( __( 'Read more', 'redline' ) . ' &raquo;' ); ?><div class="clearfix"></div>
    <?php wp_link_pages( array( 'before' => '<div id="page-links"><p><strong>' . __( 'Pages:', 'redline' ) . '</strong> ', 'after' => '</p></div>', 'next_or_number' => 'number' ) ); ?>
    </div><!--END .entry-content-->

    <!--BEGIN .entry-meta .entry-footer-->
    <section class="meta-footer"><div class="entry-meta entry-footer">
    <span class="entry-categories"><?php _e( 'Posted in', 'redline' );?> <?php echo framework_get_terms( 'cats' ); ?></span>
    <span class="meta-sep">|</span>
    <span class="comment-count"><a href="<?php comments_link(); ?>"><?php comments_number( __( 'Leave a Comment', 'redline' ), __( '1 Comment', 'redline' ), __( '% Comments', 'redline' ) ); ?></a></span>
    </div></section><!--END .entry-meta .entry-footer-->

    </div></article><!--END .hentry-->

    <?php endwhile; ?>
    <?php get_template_part( 'navigation' ) ?>
    <?php else : ?>

    <!--BEGIN #post-0-->
    <div id="post-0" class="<?php semantic_entries(); ?>">
    <h2 class="entry-title"><?php _e( 'Not Found', 'redline' );?></h2>

    <!--BEGIN .entry-content-->
    <div class="entry-content">
    <p><?php _e( "Sorry, but you are looking for something that isn't here.", 'redline' );?></p>
    <?php get_search_form(); ?>
    <!--END .entry-content-->
    </div>
    <!--END #post-0-->
    </div>

    <?php endif; ?>

    </div><!--END #primary .hfeed-->

    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Tuh nambain kode dibagian mana biar read more dan thumbnail berjalan normal, biar cepet balik modal gan???
     
  8. hciq22

    hciq22 Super Hero

    Joined:
    Jul 11, 2010
    Messages:
    1,328
    Likes Received:
    104
    wah kayaknya ruwet, nyimak dulu aja deh
    semoga terselesaikan ya TS :D
     
  9. Sense

    Sense Ads.id Pro

    Joined:
    Nov 23, 2010
    Messages:
    441
    Likes Received:
    102
    - the_content() di kode tsb mensyaratkan adanya quicktag <!--more--> di dalam konten, kalo gak mau repot pasang quicktag itu, harus ganti function pemanggil konten : the_content. bisa tambahin kode berikut ke functions.php :

    PHP:
    function limit_content($limit) {
    $content explode(' 'get_the_content(), $limit);

    if (
    count($content)>=$limit) {
    array_pop($content);
    $content implode(" ",$content).'...';
    } else {
    $content implode(" ",$content);
    }
    $content preg_replace('/[.+]/',''$content);
    $content apply_filters('the_content'$content);
    $content str_replace(']]>'']]>'$content);

    return 
    $content;
    }

    trus ganti func the_content jadi:
    limit_content('40'); //40 = sample jumlah batas kata.

    - the_post_thumbnail() mensyaratkan image di insert to post pas mo publish atau edit post. kalo gak mau, bisa ganti pake plugin Get the Image atau sejenis, ada banyak pilihan tergantung imagenya mau disimpan atau dipanggil kayak mana: apa imagenya ada dalam post, apa upload ftp/disimpan cross domen trus mo dipanggil lewat custom field, apa lewat halaman posting/edit di insert to post/jadi attachment dll. paling lengkap dan mudah pake aja Get the Image nya Justin Tadlock
     
  10. lagubaru

    lagubaru Ads.id Fan

    Joined:
    Mar 14, 2011
    Messages:
    108
    Likes Received:
    0
    Location:
    Cilacap

    Terima kasih ternyata bener ga boleh ada ruang ?> , sekarang 2 blog ane udah ada read more tanpa plugin sesuai yang ane harapkan, terus terang ane males pake plugin jika hanya pasang read more. Ada satu lagi nih ane jatuh hati ama theme fixed blix rasanya theme ini cocok buat GA
    Dengan kode index.php seperti ini
    <?php get_header(); ?>

    <div id="content" class="column">

    <?php if (have_posts()) : ?>

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

    <?php $custom_fields = get_post_custom(); ?>

    <?php if (isset($custom_fields['BX_post_type']) && $custom_fields['BX_post_type'][0] == 'mini') { ?>

    <hr class="low" />
    <div class="minientry">
    <p>
    <?php echo BX_remove_p(get_the_content()); ?>
    <div class="info">
    <?php comments_popup_link('(0)', '(1)', '(%)', 'commentlink', ''); ?>
    <a href="<?php the_permalink(); ?>" class="permalink" title="Permalink"><?php the_time('M j, \'y') ?><!--, <?php the_time('h:ia') ?>--></a>
    <!--<em class="author"><?php the_author() ?></em>-->
    <?php edit_post_link('Edit','<span class="editlink">','</span>'); ?>
    </div>
    </p>
    </div>
    <hr class="low" />

    <?php } else { ?>

    <div class="entry">
    <h2><a href="<?php the_permalink() ?>" title="Permalink"><?php the_title(); ?></a></h2>
    <?php ($post->post_excerpt != '') ? the_excerpt() : the_content(); ?>
    <?php wp_link_pages('before=<p class="page-links">&after=</p>'); ?>
    <p class="info">
    <?php if ($post->post_excerpt != '') { ?><a href="<?php the_permalink() ?>" class="more"><?php _e('Continue'); ?></a><?php } ?>
    <?php comments_popup_link(__('Leave a Comment'), __('1 Comment'), __('% Comments'), 'commentlink', ''); ?>
    <em class="date"><?php the_time(__('F j, Y')) ?><!-- at <?php the_time('h:ia') ?>--></em>
    <!--<em class="author"><?php the_author(); ?></em>-->
    <?php edit_post_link('Edit','<span class="editlink">','</span>'); ?>
    </p>
    </div>

    <!--
    <?php trackback_rdf(); ?>
    -->

    <?php } ?>

    <?php endwhile; ?>

    <p>
    <span class="next"><?php previous_posts_link(__('Next page')) ?></span>
    <span class="previous"><?php next_posts_link(__('Previous page')) ?></span>
    </p>

    <?php else : ?>

    <h2><?php _e('Page not found'); ?></h2>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>


    Terus masang kode di bawah ini dibagian mana ?

    <img src="<?php getImage('1'); ?>"
    height="100" width="120"
    style="DISPLAY: inline; margin: 0px 7px 0px 0px;
    FLOAT: left"/>
    <?php the_excerpt((__( '&raquo; Read more: ', 'default'))
    . the_title('', '',false)); ?>

    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php
    the_title();?>"><b>Baca Selengkapnya&gt;&gt;&gt;&gt;&gt;&gt;</b></a>
     

Share This Page