Rezultate 1 la 2 din 2

Subiect: Numerotarea paginilor

  1. #1
    Avatarul lui Florin M
    Florin M este deconectat Membru SeoPedia
    Reputatie:
    24
    Data înscrierii
    27th June 2011
    Locaţie
    Suceava, Romania
    Vârstă
    36
    Posturi
    121
    Putere Rep
    24


    Implicit Numerotarea paginilor

    Bună,

    Dacă o temă nu permite numerotarea paginilor și nici plugin-urile gen WP-PageNavi sau OB Page Numbers nu funcționează pe acea temă, s-ar putea face ceva în codul temei pentru a se putea afișa numerotarea paginilor?
    Mulțumesc!

  2. #2
    Avatarul lui ionutzz23
    ionutzz23 este deconectat Membru SeoPedia
    Reputatie:
    32
    Data înscrierii
    6th April 2011
    Locaţie
    Bucuresti
    Vârstă
    29
    Posturi
    196
    Putere Rep
    32


    2 out of 2 members found this post helpful.

    Implicit

    Adauga in functions.php
    function wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
    global $request, $posts_per_page, $wpdb, $paged;
    if(empty($prelabel)) { $prelabel = '«';
    } if(empty($nxtlabel)) {
    $nxtlabel = '»';
    } $half_pages_to_show = round($pages_to_show/2);
    if (!is_single()) {
    if(!is_category()) {
    preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches); } else {
    preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches); }
    $fromwhere = $matches[1];
    $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
    $max_page = ceil($numposts /$posts_per_page);
    if(empty($paged)) {
    $paged = 1;
    }
    si pentru afisare foloseste:
    if(function_exists('wp_pagenavi')) { wp_pagenavi('', '', '', '', 3, false);}
    Si acum ar trebui sa mearga.

    --- Later Edit --- (ca mi-a fost lene sa apas "Edit")

    Scuze!
    Nu ti-am dat toata functia din functions.php

    function wp_pagenavi($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
    global $request, $posts_per_page, $wpdb, $paged;
    if(empty($prelabel)) { $prelabel = '«';
    } if(empty($nxtlabel)) {
    $nxtlabel = '»';
    } $half_pages_to_show = round($pages_to_show/2);
    if (!is_single()) {
    if(!is_category()) {
    preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches); } else {
    preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches); }
    $fromwhere = $matches[1];
    $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
    $max_page = ceil($numposts /$posts_per_page);
    if(empty($paged)) {
    $paged = 1;
    }
    if($max_page > 1 || $always_show) {
    echo "$before <div class='Nav'><span>Pages ($max_page): </span>"; if ($paged >= ($pages_to_show-1)) {
    echo '<a href="'.get_pagenum_link().'">&laquo; first</a> '; }
    previous_posts_link($prelabel);
    for($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { if ($i >= 1 && $i <= $max_page) { if($i == $paged) {
    echo "<span class='on'>$i</span>";
    } else {
    echo ' <a href="'.get_pagenum_link($i).'">'.$i.'</a> '; }
    }
    }
    next_posts_link($nxtlabel, $max_page);
    if (($paged+$half_pages_to_show) < ($max_page)) {
    echo ' <a href="'.get_pagenum_link($max_page).'">last &raquo;</a>'; }
    echo "</div> $after";
    }
    }
    }

Informații subiect

Utilizatori care navighează în acest subiect

Momentan este/sunt 1 utilizator(i) care navighează în acest subiect. (0 membrii și 1 vizitatori)

Thread-uri Similare

  1. declararea paginilor
    De Paul în forumul Bar, lobby...
    Răspunsuri: 13
    Ultimul Post: 25th June 2012, 17:35
  2. Indexarea paginilor
    De ccraciun în forumul Discutii generale privind optimizarea si motoarele de cautare
    Răspunsuri: 2
    Ultimul Post: 25th November 2009, 22:14
  3. Indexarea paginilor
    De Ionut D în forumul Google
    Răspunsuri: 6
    Ultimul Post: 30th October 2009, 12:50
  4. Nelamurire la nr paginilor indexate
    De ronaldo30 în forumul Google
    Răspunsuri: 5
    Ultimul Post: 27th May 2008, 00:08
  5. Auditarea paginilor web
    De thefan în forumul Utile
    Răspunsuri: 5
    Ultimul Post: 17th December 2007, 14:09

Permisiuni postare

  • Nu puteţi posta subiecte noi.
  • Nu puteţi răspunde la subiecte
  • Nu puteţi adăuga ataşamente
  • Nu puteţi modifica posturile proprii
  •