CARA MEMBUAT PAGE NUMBER TANPA MENGGUNAKAN PLUGINS DI WORDPRESS

2104
nasty blonde hoe ivana sugar gets ready.sitewww.sexvideos2.net
sitethehun
xxx matchless fleshly scene.
CARA MEMBUAT PAGE NUMBER TANPA MENGGUNAKAN PLUGINS DI WORDPRESS

CARA MEMBUAT PAGE NUMBER TANPA MENGGUNAKAN PLUGINS DI WORDPRESS – Membuat sebuah page number dengan menggunakan plugins telah saya jelaskan pada artikel yang sebelumnya dengan judul Cara Menambahkan Nomor Halaman dengan Menggunakan Wp-Pagenavi di Layanan WordPress, kali ini saya akan membuat tentang tutorial wordpress bagaimana cara membuat page number tanpa memakai plugins di wordpress. berikut adalah langkahnya:

copikan kode seperti dibawah ini pada  bagian file Fungtion.php difile template yang anda pakai

[php]function wp_page_number() {

 

if( is_singular() )

return;

 

global $wp_query;

 

/** Stop execution if there’s only 1 page */

if( $wp_query->max_num_pages <= 1 )

return;

&nbsp;

$paged = get_query_var( ‘paged’ ) ? absint( get_query_var( ‘paged’ ) ) : 1;

$max   = intval( $wp_query->max_num_pages );

&nbsp;

/** Add current page to the array */

if ( $paged >= 1 )

$links[] = $paged;

&nbsp;

/** Add the pages around the current page to the array */

if ( $paged >= 3 ) {

$links[] = $paged – 1;

$links[] = $paged – 2;

}

&nbsp;

if ( ( $paged + 2 ) <= $max ) {

$links[] = $paged + 2;

$links[] = $paged + 1;

}

&nbsp;

echo ‘<div class=”navigation”><ul>’ . “\n”;

&nbsp;

/** Previous Post Link */

if ( get_previous_posts_link() )

printf( ‘<li>%s</li>’ . “\n”, get_previous_posts_link() );

&nbsp;

/** Link to first page, plus ellipses if necessary */

if ( ! in_array( 1, $links ) ) {

$class = 1 == $paged ? ‘ class=”active”‘ : ”;

&nbsp;

printf( ‘<li%s><a href=”%s”>%s</a></li>’ . “\n”, $class, esc_url( get_pagenum_link( 1 ) ), ‘1’ );

&nbsp;

if ( ! in_array( 2, $links ) )

echo ‘<li>…</li>’;

}

&nbsp;

/** Link to current page, plus 2 pages in either direction if necessary */

sort( $links );

foreach ( (array) $links as $link ) {

$class = $paged == $link ? ‘ class=”active”‘ : ”;

printf( ‘<li%s><a href=”%s”>%s</a></li>’ . “\n”, $class, esc_url( get_pagenum_link( $link ) ), $link );

}

&nbsp;

/** Link to last page, plus ellipses if necessary */

if ( ! in_array( $max, $links ) ) {

if ( ! in_array( $max – 1, $links ) )

echo ‘<li>…</li>’ . “\n”;

&nbsp;

$class = $paged == $max ? ‘ class=”active”‘ : ”;

printf( ‘<li%s><a href=”%s”>%s</a></li>’ . “\n”, $class, esc_url( get_pagenum_link( $max ) ), $max );

}

&nbsp;

/** Next Post Link */

if ( get_next_posts_link() )

printf( ‘<li>%s</li>’ . “\n”, get_next_posts_link() );

&nbsp;

echo ‘</ul></div>’ . “\n”;

&nbsp;

}[/php]

Sesudah anda menambahkan script tadi, sekarang copikan tag php seperti dibawah ini pada file index.php, category.php, tags.php dan juga archive.php yang berada di dalam folder template yang anda gunakan. script php dibawah ini dipakai untuk memanggil fungsi yang telah anda buat tadi dengan menggunakan nama function wp_page_number, dan ganti default script previous_posts_link and next_posts_link dengan menggunakan script dibawah ini.

1 <?php wp_page_number(); ?>

jika anda hendak memperindah tampilan dari page number yang anda buat tadi, silahkan copy kode CSS yang adadibawah ini dan letakan di file Style.CSS di Folder Template yang anda pakai.

[php].navigation li a,

.navigation li a:hover,

.navigation li.active a,

.navigation li.disabled {

color: #fff;

text-decoration:none;

}

&nbsp;

.navigation li {

display: inline;

}

&nbsp;

.navigation li a,

.navigation li a:hover,

.navigation li.active a,

.navigation li.disabled {

background-color: #38B7EE;

border-radius: 30px;

cursor: pointer;

padding: 5px 10px;

transition:all 0.25s linear 0s;

}

&nbsp;

.navigation li a:hover,

.navigation li.active a {

background-color: #000;

}[/php]

Selamat mencoba.

Baca juga: CARA MEMBUAT SCROLL TOP SEDERHANA DI WORDPRESS

0
0%
like
0
0%
love
0
0%
haha
0
0%
wow
0
0%
sad
0
0%
angry

advicewebsite advicestepmom caught squirting outdoor and fucked by tarzan. https://jav777.me/ gorgeous hotty flaunts buns and gets a smothering thrill. xem sex horny brunette babe lexi bloom.