Forum Replies Created
-
AuthorPosts
-
chad1008Member
Unreal.
That's awesome - even solves the problem of the phantom navigation links that I was going to have to tackle next.
Just saved me a ton of time working all of that out... Thanks a MILLION.
chad1008Member@Susuan That's good solution, but I think I'm too stubborn to give up on coding it myself 😉
@Genesis DeveloperOkay, let me back up a step then. Before the query modification I posted above, I was working with this custom loop function:
remove_action ('genesis_loop', 'genesis_do_loop'); add_action( 'genesis_loop', 'w2wp_custom_loop' ); function w2wp_custom_loop() { //Set up post count and pagination values global $paged; $homepage_count = 3; $otherpage_count = 2; $paged = $paged ? $paged : 1; //Use homepage post count on first page with no offset if ( $paged == 1 ) { $posts_per_page = $homepage_count; $offset = 0; // Use other pages post count on second page, offset by homepage post count } elseif ( $paged == 2 ) { $posts_per_page = $otherpage_count; $offset = $homepage_count; // use other page post count on all other pages. Offset by number of posts displayed on the homepage, plus all other pages before the current. } else { $posts_per_page = $otherpage_count; $offset = $homepage_count + ( $otherpage_count * ( $paged - 2 ) ); } global $query_args; // grab the current wp_query() args $args = array( 'posts_per_page' => $posts_per_page, 'offset' => $offset, 'paged' => $paged, // respect pagination 'post_type' => array( 'post', 'w2wp_video' ) ); genesis_custom_loop( wp_parse_args($query_args, $args) ); }
The pagination and offsets all work! The only problem is that I get a 404 message displaying after the posts on any page that shouldn't exist based on the post count value in Reading Settings. Any suggestions?
chad1008Memberugh. Let's just say my level of customization is such that I should have known better. 😉
I seem to have a developed a bad habit of looking so hard at Genesis and it's handy hooks and snippets that I completely overlook basic WordPress functions I've been using for years.
Thanks Lauren!
chad1008MemberI'd like to do the same thing. Example:
A post categorized under:
California (Parent Category), Sonoma County (Child Category), Alexander Valley (Grandchild Category)Will list as "Alexander Valley, California, Sonoma."
I'd rather it list the in order of the hierarchy, starting with the parent category and moving down the tree.
Thanks in advance!
chad1008MemberThis was perfect.
If anyone needs to link the description to the homepage of their site, this is how I modified Brad's snippet:
//Link Site Description To Homepage-------------------------- remove_action( 'genesis_site_description', 'genesis_seo_site_description' ); add_action( 'genesis_site_description', 'custom_site_description' ); function custom_site_description() { echo "<p id='description'><a href='" . get_bloginfo('url') . "'>" . get_bloginfo('description') . "</a></p>"; };
Thanks Brad!
chad1008Member<facepalm>
Yeah. Holy "miss the forest for the trees."
Thanks!
-
AuthorPosts