grapesodabanked
Forum Replies Created
-
Forum: Plugins
In reply to: [Infinite-Scroll] Infinite scroll on multiple tabs of same pageSup. I managed to find a workaround.
What I did first is create different loops with different paginations, so they all load different content when you scroll down. First, I got these $paged vars at the top of my code somewhere:
$paged1 = isset( $_GET['paged1'] ) ? (int) $_GET['paged1'] : 1; $paged2 = isset( $_GET['paged2'] ) ? (int) $_GET['paged2'] : 1; $paged3 = isset( $_GET['paged3'] ) ? (int) $_GET['paged3'] : 1;
Then, you create different WP_Queries for every loop, so tab 1, for example, would be something like this:
$args1 = array( 'paged' => $paged1 //some other arguments ); $query1 = new WP_Query($args1); if ($query1->have_posts()) : while ($query1->have_posts()) : $query1->the_post(); //do stuff for each post endwhile; endif;
Then, add a different pagination for each loop, like so:
$pag_args1 = array( 'format' => '?paged1=%#%', 'current' => $paged1, 'total' => $query1->max_num_pages, 'add_args' => array('paged2' => $paged2, 'paged3' => $paged3)//add the other $paged vars in this array, so they can be passed on in the URL and the current page of the other loops won't change when you scroll/click ); echo paginate_links($pag_args1);
So, you do that for each tab, and you now have 3 tabs with 3 different loops and separate paginations ready to go. Now, you can call the infinite scroll on them. I did this manually (for now), by adding the basic infinite scroll line to the footer.php that’s in the /templates folder, something like this:
var tab_one_scroll = "{navSelector : '#tab-one .pagination', nextSelector : '#tab-one .pagination .next_page a', itemSelector : '#tab-one .photos .photo', callback : '' }"; jQuery( tab_one_scroll.contentSelector ).infinitescroll( tab_one_scroll, function(newElements, data, url) { eval(tab_one_scroll.callback); });
So the infinite scroll is automatically called on the first tab when the page loads. If you don’t specify the specific tab (and, therefore, loop), you’re gonna accidentally load multiple tabs when you scroll down, so that’s why I only called it on the first one. For each additional tab, I do the same, but I wrap it in a click event, so the infinite scroll only gets triggered when the tab navigation is clicked. Like so:
jQuery(document).on('click', '#tab-two-navigation-link', function(e){ //repeat tab 1 code for tab 2 });
So now you have different content loading for each tab, and a new instance of infinite scroll is triggered each time someone clicks the tab navigation, so when you reach the bottom of one tab, you can still scroll the others. Probably could be cleaner, but this did the job for me. Hope it helps!
Forum: Plugins
In reply to: [Infinite-Scroll] Infinite scroll on multiple tabs of same pageYup, same problem here. I have multiple tabs with infinite scroll “walls” inside of each tab. I am using the “active” attribute for each tab to call the infinite scroll on it so it only scrolls inside the active tab, but once I reach the bottom of one tab, the other tabs aren’t scrolling anymore.
Did you figure this out by any chance?
Forum: Plugins
In reply to: [Ajaxy Instant Search] Search album posts by artist AND title simultaneously?Found the problem. I only tried this with custom post types. I tried putting a default post in a certain taxonomy or category and it works flawless!
My guess is that my theme does something funny while registering custom post types or something, but I’ll figure it out!
Thanks! I’ll sure as hell donate to this plugin! Would’ve cost a LOT of time to make this myself ^^
Forum: Plugins
In reply to: [Ajaxy Instant Search] Search album posts by artist AND title simultaneously?Nope. No matter what I try, it doesn’t work. I even went into my database, manually deleted old fields and everything, reinstalled, everything. Every time I search a default category or custom taxonomy, I just get the category/taxonomy itself, still none of the posts in it.. The posts show up when I search for their title, but I would like something where I can search for an artist (custom taxonomy) and then it would show the taxonomy (which it does) and a few of the posts under that taxonomy..
All the other functionality works great, though
Forum: Plugins
In reply to: [Ajaxy Instant Search] Search album posts by artist AND title simultaneously?That’s exactly what I want, but I couldn’t find “search category posts” anywhere. Only “Show Posts under Category” in the Category templates section. Is this what you mean? I put this to “yes” before, but it doesn’t seem to change anything…
Whenever I search the name of a category or a taxonomy term, only the category or taxonomy term itself shows in the live search and none of the posts under the category or taxonomy…
Forum: Plugins
In reply to: [Message Flow] Custom Taxonomy support?Alright! This probably depends on how you registered your taxonomies and everything, but I got it to work like this with what I’m working on:
in the $default_params array, add this:
‘post_type’ => ”,
‘tax_query’ => array(
array(
‘taxonomy’ => ”,
‘field’ => ‘slug’,
‘terms’ => ”
)
)in the $get_post_args array, add this:
‘post_type’ => $params[‘post_type’],
‘tax_query’ => array(
array(
‘taxonomy’ => $params[‘taxonomy’],
‘field’ => ‘slug’,
‘terms’ => $params[‘term’],
)
)my shortcodes now work like this:
[message-flow taxonomy=”insert taxonomy slug” term=”insert taxonomy term slug” post_type=”insert post type slug”]Can someone confirm that this is a good approach or expand on this?