Forum Replies Created
-
AuthorPosts
-
July 29, 2015 at 1:36 am in reply to: Template Genesis: Use template_redirect OR genesis_meta? #160829
Grégoire Noyelle
MemberHi Christoph
Thanks a lot to confirm that.
CheersGrégoire Noyelle
MemberHi
It will easier if you add all your URL in the post 🙂
For the first point, you can reset all the padding for the single and add again except for the img.
I don't know you're plugin (URL?) but it will be easier to add featured image with a hook. You have more control and you avoid this kind of CSS problems.
I do recommend the Genesis Visual Hook plugin to find the right place.Cheers
GrégoireGrégoire Noyelle
MemberThanks @Nick . You give me the idea about pre_get_posts 🙂
It's opens so many possibilities about CPT archive page with a clean URLGrégoire Noyelle
MemberHi
I find the solution. It works great even if the setting for archive is more important than the number of CPT.
I hope It can help.Here is the solution:
For the CPT (gnpost_evenement) archive page (archive-gnpost_evenement.php) I put:
<?php // custom loop for cpt archive remove_action( 'genesis_loop', 'genesis_do_loop'); add_action('genesis_loop','gn_loop_event'); function gn_loop_event() { $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => 'gnpost_evenement', 'orderby' => 'title', 'order' => 'DESC', 'paged' => $paged ); global $wp_query; $wp_query = new WP_Query( $args ); if (have_posts() ) : while ( have_posts() ) : the_post(); $boucle = new BBPostEvent('event-grid'); endwhile; do_action( 'genesis_after_endwhile' ); wp_reset_query(); endif; } // function gn_loop_event() genesis();
The difference here is that I do not put the
posts_per_page
parameter. For that I use a plugin OR the functions.php to make some filter. To make it works, you have to fire up this before caling the template file.// Filter for custom post type gnpost_evenement add_filter( 'pre_get_posts', 'gn_event_archive_filter' ); function gn_event_archive_filter( $query ) { if ( $query->is_post_type_archive( 'gnpost_evenement' ) ) : $query->set( 'posts_per_page', 4 ); endif; }
Special thanks to @david-decker, @Nick and @genwrock
Grégoire Noyelle
Memberthanks @genwrock I try but it change nothing.
I make some other tests today.
* I swich to genesis sample to be sure to not influence the theme with other actions
* I add the same archirve-$posttype.php with custom in genesis sample (all the CPT are made with a home made plugin)
* I try pagination as before and I get the same bugs. 404, problem if Settings > Reading > number is more important thant the total of CPT
* If I remove the custom loop, everything is normalI don't know if this is a Genesis Bug or WordPress one. But that anoying.
It will be ok, if I can use a page with the same slug (thant the cpt archive) to make a custom loop. But as I said, If I delete the archirve-$posttype.php, that's the index.php which have stronger priority.
Grégoire Noyelle
MemberI try to make a page with a custom template with the same loop and the same slug as CPT
gnpost_evenement
.
But even, if I delete the file archive-gnpost_evenement.php (archive-$posttype.php) the theme take theindex.php
file as template and note the page 🙁Grégoire Noyelle
MemberGood catch Nick. Thanks a lot to take the time for that.
I try, and it change nothing. The only case which works perfect is when I set up Settings > Reading > Blog pages show at most to “1″
Not really usefull for all the other archive page.Grégoire Noyelle
MemberWith a custom template and the exact same $wp_query, I have no problem at all but for me the URL result is just so "bad" and you need a blanck page.
What a shame like genesis supportgenesis-cpt-archives-settings
Grégoire Noyelle
MemberThanks a lot @Nick
I just have 20 post on this custom post type and the general setting for Setting > Reading was on 24. You're right 🙂
But to make it works, i have to change theorderby
parameter and removepaged
parameter and add it again.
And If I try to put Setting > Reading on 18, the pagination still works except for the last one, I get a 404.Finaly It always works if I put Setting > Reading on 1. But that's not the good solution for all the website archive.
Really odd. It seems to be very unstable. I hope to find a better solution to handle it.
Grégoire Noyelle
MemberI do think that's a conflict with the archive-$posttype.php model.
I made a lot of genesis custom loop in custom template and It works perfect. But now I need to have more logical url and use the custom post type archive model without creating a new page.
Grégoire Noyelle
Member@david-decker Same result
@Nick Thanks for the help. That's the first thing I make 🙂Grégoire Noyelle
MemberHi Dave
Thanks a lot. Good to see you here 🙂I try but It do not work. And I want to avoid a custom page template for that.
I wonder if it comes from the archive-gnpost_evenement.php (archive-$posttype.php) template?Cheers
Grégoire Noyelle
MemberI forget to mention that the real name of the custom archive page is : archive-gnpost_evenement.php
Grégoire Noyelle
MemberHello
For Child theme two things to do:
1- in functions.php add:
load_child_theme_textdomain( 'theme-name', get_stylesheet_directory() . '/lib-gn/language-theme' );
`
The language-theme is my folder for all po, mo files and the 'theme-name' is the localization name.
2. for your mo and po files, just use this names for french:
fr_FR.mo
fr_FR.poThat's all
CheersGrégoire Noyelle
MemberGrégoire Noyelle
MemberHello Claude
The string you're are talking about comes from Genesis Frameworks
Normally the plugins Genesis Translation do the right job. I made the french part.
Cheers
GrégoireGrégoire Noyelle
MemberHi Remkus
Before I have an GlotPress account. Did you keep it?
When I use the same credential, it stop workingThanks
Grégoire
-
AuthorPosts