Forum Replies Created
-
AuthorReplies
-
Eleven Sites
ParticipantThanks Jason. What an idiot I am! That’s what I get for not just copy/pasting your code originally! I apologize for my stupidity.
Eleven Sites
ParticipantHi Jason,
In addition to the search form, the client would like to customize the pagination to say “Page # of #”. I have the following code that I’ve used in the past to do this.
function custom_pagination() { global $wp_query; $total = $wp_query->max_num_pages; // only bother with the rest if we have more than 1 page! if ( $total > 1 ) { // get the current page if ( !$current_page = get_query_var('paged') ) $current_page = 1; // structure of "format" depends on whether we're using pretty permalinks if( get_option('permalink_structure') ) { $format = '&paged=%#%'; } else { $format = 'page/%#%/'; } echo '<span class="custom_pagination">Page '.$current_page.' of '.$total.'</span> '; echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' => $format, 'current' => $current_page, 'total' => $total, 'mid_size' => 10, 'prev_next' => False, 'prev_text' => __(''), 'next_text' => __(''), 'type' => 'plain' )); } }
Eleven Sites
ParticipantWell, I was simply trying to control the ‘archive’ layout for my custom post type. Here’s my dev link: http://50.87.248.227/~parkrang/cms/strains/. Here, for the custom post type “strains”, users will be able to browse by keyword.
My template is content-list-strains.php. And, my code is mentioned previously.
So, on the Content tab under Archives, I’ve set the Post Display to be List. I’d just like to understand where the pagination (‘list_paginated’) comes into play, if I don’t have the option in the Theme Options to select paginated or not, and my template doesn’t have any pagination.
Thanks for helping my wrap my head around this!
Eleven Sites
ParticipantHi Jason,
I’m just confused as to why, even though my template does not use pagination, I need to have:
if ( $id == ‘list’ || $id == ‘list_paginated’ ) {
$part = ‘list-strains’;
}instead of simply:
if ( $id == ‘list’) {
$part = ‘list-strains’;
}Thanks for the updated documentation. The “Multiple post types, a more dynamic way” section is wonderful!
Eleven Sites
ParticipantNever mind, I got it to work by adding ‘list_paginated’. Curious!
// “Strains” list
if ( $id == ‘list’ || $id == ‘list_paginated’ ) {
$part = ‘list-strains’;
}Eleven Sites
ParticipantThanks for asking this, AskWPGirl. I’m so glad I found this. But, I’m still having trouble with this for my custom post type. I’ve used the following code:
function my_template_part( $part, $id ) {
if ( get_post_type() == ‘strains’ ) {
// “Strains” single posts
if ( $id == ‘single’ ) {
$part = ‘single-strains’;
}// “Strains” post grid
if ( $id == ‘grid’ || $id == ‘grid_paginated’ ) {
$part = ‘grid-strains’;
}// “Strains” list
if ( $id == ‘list’) {
$part = ‘list-strains’;
}
}return $part;
}
add_filter( ‘themeblvd_template_part’, ‘my_template_part’, 10, 2 );But, my template’s still not being used.
Thanks!
January 12, 2015 at 3:43 pm in reply to: Strange issue: Adding to themeblvd_header_menu_default() #20059Eleven Sites
ParticipantOK, it’s fixed. A little sleep helped. It was WP Super Cache. I had to turn the caching completely off. Deleting my cache on WordPress and on my browsers wasn’t doing it.
And, the world makes sense again…
Eleven Sites
ParticipantYes, I haven’t tackled v2 yet. Hopefully, I’ll have some time to work with v2 beta in the next few days.
Eleven Sites
ParticipantI’d be happy to test it on one of my big sites (re: frontend plugins using Ajax)!
Eleven Sites
ParticipantHi Jason,
I just realized that when using the toggle shortcode, the title/link label has an extra space on the front of it. So, if I style my toggle label to have text-decoration: underline; that space shows up. I don’t exactly know where to fix this, so I thought I’d let you know.
Thanks,
Lindsay
September 6, 2014 at 2:53 am in reply to: Changing 'archive_no_posts' local based on post type #18498Eleven Sites
ParticipantI’ve created custom queries in the functions file to be used in the post display shortcode like the following:
<h2 class="assets">Photos</h2><?php
echo do_shortcode('[post_grid query="photos" link="false" columns="4"]');
?>July 18, 2014 at 10:46 pm in reply to: Plugin running before the theme registers its shortcodes #17838Eleven Sites
ParticipantHi Jason, I got the following code to work with some CSS help. But, I don’t know how to get the div.rows in there…
<?php $i = 0; ?> <?php while ( have_posts() ) : the_post(); ?> <?php $i++; ?> <div class="column grid_3<?php echo (0 == $i % 4) ? ' last' : ''; ?>"> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php the_content(); ?> <h2 class="entry-title"><?php the_title(); ?></h2> </div> </div> </div> <?php endwhile; ?>
.column:nth-child(4n) { margin-right: 0; } .column:nth-child(4n+1) { clear: left; }
So, will I be able to open the thumbnail image/featured image in a lightbox for the Photos?
Thanks!
July 18, 2014 at 3:25 pm in reply to: Plugin running before the theme registers its shortcodes #17826Eleven Sites
ParticipantJason,
I’m stuck without the shortcodes working in my faceted search templates. I’m having trouble coding the grids to display correctly without the shortcodes. I’d also need for my images to open up in the lightbox.
I have a Manufacturer Photos page and a Manufacturer Videos page that have a faceted search and I wanted the results to be a 4-column grid of the thumbnails. The Photos would open in a lightbox, the videos will be thumbnail YouTube players.
What can I do to keep moving forward and getting this site launched?
July 17, 2014 at 8:58 pm in reply to: Plugin running before the theme registers its shortcodes #17816Eleven Sites
ParticipantHi Jason,
When do you anticipate the next update to the theme supporting these frontend plugins using Ajax?
Thanks,
Lindsay
July 7, 2014 at 7:53 pm in reply to: Plugin running before the theme registers its shortcodes #17655Eleven Sites
ParticipantAwesome, Jason. Thanks for your help… I wish I understood all of this more, but I’ve got some learning to do!
-
AuthorReplies