WordPress embarqué et pagination (Créer un compte)

  • Statut : non résolu
3 sujets de 1 à 3 (sur un total de 3)
  • Auteur
    Messages
  • #539967
    natchoum
    Membre
    Chevalier WordPress
    162 contributions

    Bonjour,

    Ma configuration WP actuelle
    – Version de WordPress : 3.9.1
    – Version de PHP/MySQL : PHP : 5.3.10 / MySQL : Distrib 5.5.38, for debian-linux-gnu (x86_64)
    – Thème utilisé : Un thème propriétaire que j’ai fabriqué moi même.
    – Extensions en place : WordPress Social Ring et WP-PageNavi.
    – Nom de l’hebergeur : online.net
    – Adresse du site : Serveur de développement, je n’ai pas le droit de vous donner les accès :S

    Problème(s) rencontré(s) :

    Bonjour, je travaille sur la refonte d’un site de recherche d’emploi. Mon entreprise avait déjà choisi un outil ( propriétaire et mal documenté bien sûr 😋 ) avec lequel j’ai développé le site en question. Pour la partie blog, j’ai décidé d’inclure un wordpress ( bien que ce soit ma première tentative avec ) et jusqu’à présent tout se passait à merveille.

    Jusqu’à ce que je m’attaque à la pagination, je précise :
    L’internaute n’a accès qu’à quelques pages : la liste des posts pour une catégories ( il y en a deux au total ) et la page présentant un post ( quel qu’il soit ).
    J’ai tenté de faire la pagination à la main, sans succès et avec le plugin WP-PageNavi sans plus de résultats.

    Lorsque je tente d’aller en page 2 ( dans la liste de posts par catégorie ), je me ramasse une 404.
    Voici un patern de mes urls pour le wordpress :

    /blog/actualites/ => liste des actualités -> ça fonctionne
    /blog/actualites/page/2 => 2ème page de la liste des actualités -> 404
    /blog/actualites/titre-de-mon-article => visualisation d’un post -> ça fonctionne

    Le dossier blog étant le dossier dans lequel est installé wordpress.

    J’ai l’impression que la technique utilisée par wordpress pour gérer les urls ( qui ne semble pas être dans le .htaccess ) entre en conflit avec les règles de réécritures communes tout mon site ( via un .htaccess à la racine ). En effet, je ne pense pas avoir fait d’erreurs en php sur quelque chose d’aussi simple ( j’ai entre autre suivi les instructions ici

    Voici le .htaccess à la racine de mon site :

    RewriteEngine On
    RewriteBase /
    php_value display_errors off
    #Require valid-user
    AddType video/ogg .ogv
    AddType video/mp4 .mp4
    AddType video/webm .webm
    AddType video/avi .avi

    RewriteCond %{HTTP_HOST} ^test.com$
    RewriteRule ^(.*) http://www.test.com/$1 [QSA,L,R=301]

    #RewriteCond %{HTTP_HOST} ^test.com$
    #RewriteRule ^(.*) http://www.test.com/$1 [QSA,L,R=301]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* ./index.php


    ## A REMETTRE SI LE JB N’EST PAS DANS UN SOUS DOMAINE RedirectPermanent http://test.com/admin/* http://www.test.com/admin/$1
    RedirectPermanent http://www.test.com/admin/ http://www.test.com/admin/$1
    RedirectPermanent http://www.test.com/admin/* http://www.test.com/admin/$1

    #——redirection des sitesPages——#
    RedirectPermanent /recruteurs/ http://test.com/tarifs/
    RedirectPermanent /souscription/ http://test.com/tarifs/
    RedirectPermanent /activate_listing/ http://test.com/activer-fiche/
    RedirectPermanent /add_listing/ http://test.com/depot-fiche/
    RedirectPermanent /add_notes/ http://test.com/ajouter-commentaire/
    RedirectPermanent /apply_now/ http://test.com/postuler-offre-emploi/
    RedirectPermanent /browse_by_company/ http://test.com/emplois-par-societe/
    RedirectPermanent /browse_by_city/ http://test.com/emplois-par-ville/
    RedirectPermanent /callback/ http://test.com/repondre/
    RedirectPermanent /category/ http://test.com/categories/
    RedirectPermanent /clone_jobs/ http://test.com/dupliquer-emploi/
    RedirectPermanent /contact/ http://test.com/nous-contacter/
    RedirectPermanent /contact_seller/ http://test.com/contacter-recruteur/
    RedirectPermanent /create_contract/ http://test.com/souscrire-package/
    RedirectPermanent /display_job/ http://test.com/emploi/
    RedirectPermanent /consulter-offre-emploi/ http://test.com/emploi/
    RedirectPermanent /display_resume/ http://test.com/CV/
    RedirectPermanent /consulter-CV/ http://test.com/CV/
    RedirectPermanent /display_listing/ http://test.com/fiche/
    RedirectPermanent /edit_listing/ http://test.com/soumettre-fiche/
    RedirectPermanent /edit_notes/ http://test.com/soumettre-commentaire/
    RedirectPermanent /edit_profile/ http://test.com/soumettre-profil/
    RedirectPermanent /employers_list/ http://test.com/liste-recruteurs/
    RedirectPermanent /find_jobs/ http://test.com/rechercher-emploi/
    RedirectPermanent /informations_legales/ http://test.com/conditions-utilisation-candidat/
    RedirectPermanent /legal_terms/ http://test.com/conditions-utilisation-recruteur/
    RedirectPermanent /listing_details/ http://test.com/details-fiche/
    RedirectPermanent /my_account/ http://test.com/mon-compte/
    RedirectPermanent /my_jobs/ http://test.com/mes-offres/
    RedirectPermanent /my_job_details/ http://test.com/details-mes-offres/
    RedirectPermanent /my_listings/ http://test.com/mes-fiches/
    RedirectPermanent /my_resume_details/ http://test.com/details-mon-CV/
    RedirectPermanent /password_recovery/ http://test.com/recuperation-password/
    RedirectPermanent /payments/ http://test.com/paiements/
    RedirectPermanent /payment_page/ http://test.com/page-paiement/
    RedirectPermanent /registration/ http://test.com/inscription/
    RedirectPermanent /saved_jobs/ http://test.com/emplois-sauvegardes/
    RedirectPermanent /saved_listings/ http://test.com/fiches-sauvegardees/
    RedirectPermanent /saved_resumes/ http://test.com/CV-sauvegardes/
    RedirectPermanent /saved_searches/ http://test.com/recherches-sauvegardees/
    #RedirectPermanent /save_search/ http://test.com/sauvegarder-recherche/
    RedirectPermanent /search_results/ http://test.com/resultats/
    RedirectPermanent /search_results_jobs/ http://test.com/resultats-emplois/
    RedirectPermanent /search_results_resumes/ http://test.com/resultats-CV/
    RedirectPermanent /search_resumes/ http://test.com/rechercher-CV/
    RedirectPermanent /subscription/ http://test.com/souscription/
    RedirectPermanent /tell_friends/ http://test.com/transmettre-a-un-ami/
    RedirectPermanent /mon-compte/ http://test.com/
    RedirectPermanent /alertes-emploi/ http://test.com/job_alerts
    RedirectPermanent /alertes-CV/ http://test.com/resume_alerts

    RedirectPermanent /activate_listing http://test.com/activer-fiche
    RedirectPermanent /add_listing http://test.com/depot-fiche
    RedirectPermanent /add_notes http://test.com/ajouter-commentaire
    RedirectPermanent /apply_now http://test.com/postuler-offre-emploi
    RedirectPermanent /browse_by_company http://test.com/emplois-par-societe
    RedirectPermanent /browse_by_city http://test.com/emplois-par-ville
    RedirectPermanent /callback http://test.com/repondre
    RedirectPermanent /category http://test.com/categories
    RedirectPermanent /clone_jobs http://test.com/dupliquer-emploi
    RedirectPermanent /contact http://test.com/nous-contacter
    RedirectPermanent /contact_seller http://test.com/contacter-recruteur
    RedirectPermanent /create_contract http://test.com/souscrire-package
    RedirectPermanent /display_job http://test.com/emploi
    RedirectPermanent /consulter-offre-emploi http://test.com/emploi
    RedirectPermanent /display_resume http://test.com/CV
    RedirectPermanent /consulter-CV http://test.com/CV
    RedirectPermanent /display_listing http://test.com/fiche
    RedirectPermanent /edit_listing http://test.com/soumettre-fiche
    RedirectPermanent /edit_notes http://test.com/soumettre-commentaire
    RedirectPermanent /edit_profile http://test.com/soumettre-profil
    RedirectPermanent /employers_list http://test.com/liste-recruteurs
    RedirectPermanent /find_jobs http://test.com/rechercher-emploi
    RedirectPermanent /informations_legales http://test.com/conditions-utilisation-candidat
    RedirectPermanent /legal_terms http://test.com/conditions-utilisation-recruteur
    RedirectPermanent /listing_details http://test.com/details-fiche
    RedirectPermanent /my_account http://test.com/mon-compte
    RedirectPermanent /payment_info http://test.com/informations-paiement
    RedirectPermanent /my_jobs http://test.com/mes-offres
    RedirectPermanent /my_job_details http://test.com/details-mes-offres
    RedirectPermanent /my_listings http://test.com/mes-fiches
    RedirectPermanent /my_resume_details http://test.com/details-mon-CV
    RedirectPermanent /password_recovery http://test.com/recuperation-password
    RedirectPermanent /payments http://test.com/paiements
    RedirectPermanent /payment_page http://test.com/page-paiement
    RedirectPermanent /registration http://test.com/inscription
    RedirectPermanent /saved_jobs http://test.com/emplois-sauvegardes
    RedirectPermanent /saved_listings http://test.com/fiches-sauvegardees
    RedirectPermanent /saved_resumes http://test.com/CV-sauvegardes
    RedirectPermanent /saved_searches http://test.com/recherches-sauvegardees
    RedirectPermanent /search_results http://test.com/resultats
    RedirectPermanent /search_results_jobs http://test.com/resultats-emplois
    RedirectPermanent /search_results_resumes http://test.com/resultats-CV
    RedirectPermanent /search_resumes http://test.com/rechercher-CV
    RedirectPermanent /subscription http://test.com/souscription
    RedirectPermanent /tell_friends http://test.com/transmettre-a-un-ami
    RedirectPermanent /mon-compte http://test.com/
    RedirectPermanent /alertes-emploi http://test.com/job_alerts
    RedirectPermanent /alertes-CV http://test.com/resume_alerts
    RedirectPermanent /?ai1ec=action http://test.com/blog/calendrier/?ai1ec=action
    RedirectPermanent /formulaire-pushmail/ http://www.test.com/rechercher-CV/?push=true

    RedirectPermanent /subscribe_guest http://test.com/newsletter_abonnement/

    ##Redirections 301 pour le ref nat
    #conseils
    RedirectPermanent /conseils-candidats/trucs-et-astuces.html http://test.com/blog/conseil/
    RedirectPermanent /conseils-candidats/testez-vous.html http://test.com/blog/conseil/
    RedirectPermanent /conseils-candidats/formez-vous.html http://test.com/blog/conseil/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/la_remuneration_priorite_des_candidats_meme_en_region,21.html http://www.test.com/blog/conseils/la-remuneration-priorite-des-candidats-meme-en-region/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/bien_preparer_sa_recherche_d-emploi,18.html http://www.test.com/blog/conseils/bien-preparer-sa-recherche-demploi/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/bien_preparer_son_entretien_annuel,20.html http://www.test.com/blog/conseils/bien-preparer-son-entretien-annuel/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/chercher_un_job_pendant_l-ete__une_bonne_idee_,16.html http://www.test.com/blog/conseils/chercher-un-job-pendant-lete-une-bonne-idee-2/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/choisir_une_formation_en_alternance,11.html http://www.test.com/blog/conseils/choisir-une-formation-en-alternance/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/comment_beneficier_de_votre_droit_a_la_formation_individuelle_dif_,14.html http://www.test.com/blog/conseils/comment-beneficier-de-votre-droit-a-la-formation-individuel-dif/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/comment_beneficier_d-un_bilan_de_competences_,13.html http://www.test.com/blog/conseils/comment-beneficier-dun-bilan-de-competences/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/comment_remercier_le_recruteur_a_l-issue_d-un_entretien_,17.html http://www.test.com/blog/conseils/comment-remercier-le-recruteur-a-lissue-dun-entretien/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/comment_se_comporter_en_entretien_d-embauche_,4.html http://www.test.com/blog/conseils/comment-se-comporter-en-entretien-dembauche/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/faire_la_difference_avec_son_cv,5.html http://test.com/blog/conseils/faire-la-difference-avec-son-cv/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/quelle_formation_comptable_choisir_,15.html http://www.test.com/blog/conseils/quelle-formation-comptable-choisir/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/rediger_efficacement_sa_lettre_de_motivation,3.html http://www.test.com/blog/conseils/rediger-efficacement-sa-lettre-de-motivation/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/reussir_la_negociation_de_votre_remuneration,7.html http://www.test.com/blog/conseils/reussir-la-negociation-de-votre-remuneration/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/reussir_sa_periode_d-essai,8.html http://www.test.com/blog/conseils/reussir-sa-periode-dessai/
    RedirectPermanent /conseils-candidats/trucs-et-astuces/utiliser_les_reseaux_sociaux_comme_outil_de_recrutement,10.html http://www.test.com/blog/conseils/utiliser-les-reseaux-sociaux-comme-outil-de-recrutement/
    #offres & contact
    RedirectPermanent /consultez-les-offres.html http://www.test.com
    RedirectPermanent /consultez-les-offres/rechercher.html http://www.test.com
    RedirectPermanent /contact.html http://www.test.com/nous-contacter/
    #espace etudiant
    RedirectPermanent /espace-etudiants/offres-de-stage.html http://www.test.com/etudiants/
    RedirectPermanent /espace-etudiants/demandes-de-stage.html http://www.test.com/etudiants/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles.html http://www.test.com/etudiants/ecoles/
    RedirectPermanent /espace-etudiants/fiches-metier.html http://www.test.com/etudiants/fiches-metiers/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/igefi,19.html http://www.test.com/etudiants/ecoles/igefi/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/ipag_paris_nice,11.html http://www.test.com/etudiants/ecoles/ipag-paris-nice/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/enoes_cecs,17.html http://www.test.com/etudiants/ecoles/enoes-cecs/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/esg,4.html http://www.test.com/etudiants/ecoles/esg/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/esgf,18.html http://www.test.com/etudiants/ecoles/esgf/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/ics_begue,8.html http://www.test.com/etudiants/ecoles/ics-begue/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/ifag_paris,13.html http://www.test.com/etudiants/ecoles/ifag-paris/
    RedirectPermanent /espace-etudiants/annuaire-des-ecoles/encg_formation,20.html http://www.test.com/etudiants/ecoles/encg-formation/
    #fiches metiers
    RedirectPermanent /espace-etudiants/fiches-metier/chef_comptable,5.html http://www.test.com/emplois-par-metier/chef-comptable/
    RedirectPermanent /espace-etudiants/fiches-metier/secretaire_comptable,6.html http://www.test.com/emplois-par-metier/secretaire-comptable/
    RedirectPermanent /espace-etudiants/fiches-metier/assistant_comptable,7.html http://www.test.com/emplois-par-metier/assistant-comptable/
    RedirectPermanent /espace-etudiants/fiches-metier/comptable,8.html http://www.test.com/emplois-par-metier/comptable/
    RedirectPermanent /espace-etudiants/fiches-metier/controleur_de_gestion,10.html http://www.test.com/emplois-par-metier/controleur-de-gestion/
    RedirectPermanent /espace-etudiants/fiches-metier/commissaire_aux_comptes,11.html http://www.test.com/emplois-par-metier/commissaire-aux-comptes/
    RedirectPermanent /espace-etudiants/fiches-metier/auditeur,14.html http://www.test.com/emplois-par-metier/auditeur/
    RedirectPermanent /espace-etudiants/fiches-metier/tresorier,15.html http://www.test.com/emplois-par-metier/tresorier/
    RedirectPermanent /espace-etudiants/fiches-metier/directeur_administratif_et_financier,16.html http://www.test.com/emplois-par-metier/directeur-administratif-et-financier/
    RedirectPermanent /espace-etudiants/fiches-metier/gestionnaire_de_paie,18.html http://www.test.com/emplois-par-metier/gestionnaire-paye/
    RedirectPermanent /espace-etudiants/fiches-metier/responsable_consolidation,19.html http://www.test.com/emplois-par-metier/responsable-consolidation/
    #actualites / interviews
    RedirectPermanent /actualites.html http://www.test.com/blog/actualites/
    RedirectPermanent /interviews.html http://www.test.com/blog/actualites/
    RedirectPermanent /interviews/de_nombreuses_tpepme_sous_le_risque_d-un_redressement_urssaf_au_1er_janvier_2014,14.html http://www.test.com/blog/actualites/de-nombreuses-tpe-pme-sous-le-risque-dun-redressement-urssaf-au-1er-janvier-2014/
    RedirectPermanent /interviews/defaillances_des_entreprises,13.html http://www.test.com/blog/actualites/defaillances-des-entreprises/
    RedirectPermanent /interviews/traitement_comptable_en_regles_francaises_du_credit_dimpot_pour_la_competitivite_et_lemploi_cice,12.html http://www.test.com/blog/actualites/
    RedirectPermanent /interviews/projet_de_reforme_de_l-audit_en_europe,11.html http://www.test.com/blog/actualites/projet-de-reforme-de-laudit-en-europe/
    RedirectPermanent /interviews/le_retour_de_joseph_zorgniotti_a_la_tete_du_csoec,9.html http://www.test.com/blog/actualites/le-retour-de-joseph-zorgniotti-a-la-tete-du-csoec/
    RedirectPermanent /interviews/cette_universalite_est_inscrite_dans_nos_genes_d-expert-comptable,8.html http://www.test.com/blog/actualites/un-sondage-mondial-montre-un-interet-pour-reformer-le-marche-de-laudit/
    RedirectPermanent /interviews/comment_recruter_en_interne,5.html http://www.test.com/blog/actualites/comment-recruter-en-interne/
    RedirectPermanent /interviews/kpmg__le_big_four_de_la_finance_recrute_,4.html http://www.test.com/blog/actualites/kpmg-le-big-four-de-la-finance-recrute/
    RedirectPermanent /interviews/la_methode_repos__un_modele_de_cv_innovant_et_ingenieux,3.html http://www.test.com/blog/actualites/la-methode-r-e-p-o-s-un-modele-de-cv-innovant-et-ingenieux/
    RedirectPermanent /interviews/thomas_24_ans_jeune_diplome_collaborateur_comptable,1.html http://www.test.com/blog/actualites/thomas-24-ans-jeune-diplome-collaborateur-comptable/
    #espace entreprise
    RedirectPermanent /consultez_nos_tarifs.html http://www.test.com/tarifs/
    RedirectPermanent /conditions-generales-de-vente.html http://www.test.com/conditions-utilisation-recruteur/
    RedirectPermanent /partenaires.html http://www.test.com
    RedirectPermanent /inscription_entreprises.html http://www.test.com/inscription/?user_group_id=Employer
    RedirectPermanent /inscription_candidats.html http://www.test.com/inscription/?user_group_id=JobSeeker
    RedirectPermanent /conditions-generales-d-utilisation.html http://www.test.com/mentions-legales/
    #general rewrite rules
    RewriteRule ^/actualites/(.*)$ http://www.test.com/actualites/ [QSA,L,R=301]
    RewriteRule ^/interviews.html(.*)$ http://www.test.com/actualites/ [QSA,L,R=301]
    RewriteRule ^/actualites.html(.*)$ http://www.test.com/actualites/ [QSA,L,R=301]
    RewriteRule ^/consultez-les-offres/(.*)$ http://www.test.com/ [QSA,L,R=301]

    #961931
    natchoum
    Membre
    Chevalier WordPress
    162 contributions

    Personne n’a de pistes à suivre pour éviter les 404 ?
    j’ai l’impression que wordpress pense que page/2 est le titre d’un article et il ne le trouve pas du coup.
    Est ce que quelqu’un sait si je ne prends pas le problème à l’envers par exemple ? ( désolé pour le double post mais on ne peut pas éditer semble t-il )

    #961932
    natchoum
    Membre
    Chevalier WordPress
    162 contributions

    J’ai avancé sur le problème, apparemment mon problème est courant ( bien que je ne trouve pas réellement de solution fonctionnelle ). En effet, j’ai réussi à ne plus avoir de 404 en ajoutant cette fonction dans mon fichier functions.php :

    function remove_page_from_query_string($query_string)
    {
    if ($query_string[‘name’] == ‘page’ && isset($query_string[‘page’])) {
    unset($query_string[‘name’]);
    // ‘page’ in the query_string looks like ‘/2’, so i’m spliting it out
    list($delim, $page_index) = split(‘/’, $query_string[‘page’]);
    $query_string[‘paged’] = $page_index;
    }
    return $query_string;
    }
    // I will kill you if you remove this. I died two days for this line
    add_filter(‘request’, ‘remove_page_from_query_string’);

    Désormais, je n’ai plus de 404 quand mon url passe de /blog/actualites/ à /blog/actualites/page/2 .
    Cependant, ce sont exactement les mêmes articles qui sont affichés.
    J’ai du refaire un petit système dans category.php pour récupérer la valeur de la variable page ( j’imagine qu’il y a un moyen de récupérer ça via des fonctions wp mais je n’ai pas trouvé, et ceci fonctionne ^^ ) :

    $postPerPage = 10;
    $page = $_SERVER[‘REQUEST_URI’];
    $apage = explode(« / »,$page);
    //$apage[4] countain the page number
    if(!empty($apage[4])){
    $page = (int) $apage[4];
    $offset = ($postPerPage*$page) – $postPerPage;
    }
    else{
    $offset = 0;
    }

    query_posts(« cat=$cat_id&posts_per_page=$postPerPage&offset=$offset »);

    Voilà si ça peut servir à quelqu’un, en tout cas problème résolu

3 sujets de 1 à 3 (sur un total de 3)
  • Vous devez être connecté pour répondre à ce sujet.