Riversatile
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Choosing wich pages will show their excerpts on homepage…Oui, la ça demande beaucoup plus d’expérience, dans ce cas la, j’ai en général recours à une extension, car plus simple pour paramétrer les conditions d’affichage des pages/articles en fonction de ‘custom fields’, ‘catégorie’, ‘tag’, ‘date de création’, etc…
Mais j’ai trouvé un bout de code qui permettrait de distinguer les pages que les gens veulent voir apparaître :
1) Faut ajouter :
‘meta_query’ => array(
array(
‘key’ => ‘a la une’,
‘value’ => ‘oui’
‘compare’ => ‘LIKE’Cette fonction affichera les pages dont le ‘custom field’ (champ personnalisé) nommé ‘a la une‘ apparaît avec la valeur ‘oui‘.
C’est à dire que si une personne créée une page et qu’elle souhaite la voir apparaître à la une, elle devra dans un champ personnalisé mettre ‘a la une‘ et en face mettre la valeur ‘oui‘ comme ceci :
http://www.monsterup.com/upload/1351200416234.png
puis enregistrer la page.2) Faut supprimer :
‘post__in’ => array(85,18,5,118,120,268),Voici le code final :
<?php $args=array( 'orderby' =>'parent', 'order' =>'asc', 'post_type' =>'page', 'meta_query' => array( array( 'key' => 'a la une', 'value' => 'oui' 'compare' => 'LIKE' ); $page_query = new WP_Query($args); ?> <?php while ($page_query->have_posts()) : $page_query->the_post(); ?> <div class="section"> <h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2> <?php the_excerpt(); ?> <p class="readmore"><a href="<?php the_permalink();?>">Lire la suite</a></p> </div> <?php endwhile; ?>Source pour le petit bout de code :
http://wordpress.org/support/topic/query_posts-where-custom-field-is-trueForum: Fixing WordPress
In reply to: Comment fields not displaying in blog postsNo, custom fields are not required for comments.
But in my template (single.php), I have this kind of thing :
<div id="commentform"> <form action="http://mywebsite.xxx/wp-comments-post.php" method="post" id="commentform">... ... ... </form> </div>It seems you don’t have this kind of code in your template, as I don’t see anything that deals with comments in the source code on the web browser.
Forum: Fixing WordPress
In reply to: Slider – lightbox doesn't have captionsI think you have to change the caption field into the media library on your images.
Check if the caption field is empty hereForum: Fixing WordPress
In reply to: Comment fields not displaying in blog postsDid you authorize comments in the post/page itself ?
If Google Crawlers see a content with a priority of 1.0, it will index this content faster than a content with a priority of 0.9 or 0.8 or 0.7 or 0.6 or 0.5 or 0.4 or 0.3 or 0.2 or 0.1.
So, the better solution (that I choosen) is :
(Sorry, this is a French WordPress Dashboard)
http://www.monsterup.com/upload/1351177329265.pngForum: Fixing WordPress
In reply to: Choosing wich pages will show their excerpts on homepageC’est easy mon pote !
Je vois que le site web http://www.test.denispaquet.com/ est Français, donc tu es Français !Tu dois déjà faire en sorte de faire afficher les 3 pages que tu souhaites sous forme d’extrait à la place des 3 cadres.
1) Cette fonction PHP dans le code qui suit dit qu’on récupère les page du genre ‘parent’, dans l’ordre ‘ascendant’, de type ‘page’, avec les identifiants séparés par une virgule. Et on défini la requête dans ‘new WP_Query($args);’
Ensuite on s’occupe de la mise en page des informations retournées par ‘new WP_Query($args);’
2) On dit que ‘Tant qu’il y des pages à afficher, on répète la boucle de la fonction’, on présente le titre de la page avec une balise ‘H2’ sous forme d’un lien vers la page puis on place l’excerpt juste dessous avec ‘the_excerpt’, suivi du lien ‘Lire la suite’ (read more) qui pointe vers la page.
Enfin on ferme la boucle de la fonction.Voilà le code :
(extrait de http://chasesagum.com/display-multiple-page-excerpts)<?php $args=array( 'orderby' =>'parent', 'order' =>'asc', 'post_type' =>'page', 'post__in' => array(85,18,5,118,120,268), ); $page_query = new WP_Query($args); ?> <?php while ($page_query->have_posts()) : $page_query->the_post(); ?> <div class="section"> <h2><a href="<?php the_permalink();?>"><?php the_title();?></a></h2> <?php the_excerpt(); ?> <p class="readmore"><a href="<?php the_permalink();?>">Lire la suite</a></p> </div> <?php endwhile; ?>A la place des identifiants de page en exemple :
array(85,18,5,118,120,268)
tu mets les identifiants qui correspondent à tes 3 pages, par exemple :
array(1,2,3)Apparement, vu comment est fait ton site, tu dois incorporer ce code à l’intérieur de la balise :
<div id=”content” role=”main”>
qui se trouve dans le fichier index.php de ton thème WordPress.Cordialement
Forum: Fixing WordPress
In reply to: Comment fields not displaying in blog postsDid you verify that the option “must be registered to post comment” was checked in your settings panel ?
Forum: Fixing WordPress
In reply to: Can't upload images..! ( error while uploading)Try to switch to multi-file uploader by clicking on “switch to multi-file uploader”.
Forum: Fixing WordPress
In reply to: Moderation suddenly holding an abnormal quantity of commentsComments or spam comments ?
Internet says this is possible by configuring Apache.
If it’s the case, I can’t do this because of my web provider don’t allow this kind of configuration to webmasters.Forum: Plugins
In reply to: [Easing Slider] Centering Easing Slider for NOOBYou can do this using the excerpt of your posts.
See here : http://www.problogdesign.com/how-to/the-2-methods-of-showing-excerpts/WordPress Codex for The_excerpt :
http://codex.wordpress.org/Function_Reference/the_excerptForum: Fixing WordPress
In reply to: How to add Read more link to word count limited postsWhat’s your website URL ?
Otherwise, I don’t know how to do this.
But you’re the right way with your code at the top of this page, it refers to http://codex.wordpress.org/Function_Reference/the_contentBye
Forum: Fixing WordPress
In reply to: How to add Read more link to word count limited postsI already done the thing you want to do on my website 😉
// Add 'Read more about this article...' to excerpt function excerpt_read_more_link($output) { global $post; return substr($output,0,-5).' <a href="'. get_permalink($post->ID) . '" title="Read more about ' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">Read more about this article...</a></p>'; } add_filter('the_excerpt', 'excerpt_read_more_link');You have to paste this code into your functions.php theme file.
This code generate a link ‘Read more about this article…’ with the title ‘Read more about [post_title]’. the link points to the post permalink at the end of the excerpt of each post.Tell me if this help.
Regards
DONE ! Now Flexi Pages supports page Thumbnail display 😉
Here is the final portion of code to overwrite at line 83 of the file flexi-pages-widget.php (overwrite the whole function “flexipages_list” :
function flexipages_list($page_array, $level = 0) { if(!$page_array) return; $pagelist = ""; foreach($page_array as $page) { $date = ""; $pagethumb = get_the_post_thumbnail($page['ID'], 'full', array('class' => 'attachment-thumbnail','title' => trim(strip_tags( $attachment->post_title )),)); if(isset($page['date']) && $page['date']) $date = " ".$page['date']; $pagelist .= str_repeat("\t", $level+1).'<li class="'.$page['class'].'">'.$pagethumb.''.$date; if($page['children']) $pagelist .= flexipages_list($page['children'], $level+1); $pagelist.= "</li>\n"; } if($pagelist) $pagelist = str_repeat("\t", $level)."<ul>\n{$pagelist}".str_repeat("\t", $level)."</ul>"; return $pagelist; }With a lot of search (thanks Google), I found the issue…
The value $value->ID has to be replaced by $page[‘ID’] to extract correctly the ID of each page.
$pagethumb = get_the_post_thumbnail($page['ID'], array(230,299), $attr = 'class=shopthumbnail');But I continue to improve this Thumb feature in Flexi Pages.
If someone has some suggestion…