stever7
Forum Replies Created
-
I can’t get your code to work in IE. It appears to work OK in Chrome and Firefox though. See http://cudenvertoday.org homepage, scroll down to the “CU Denver News” section where I have your filter by category in place. In IE, each time I click a category it brings me to the top of the page and does not trigger the filter.
I’ve tried your solution above, but that didn’t work. Can you take a look at the code?
Thanks,
SteveAny thoughts on this? I saw your tweet reply to me that I could clear the search value, but I’m not sure what you mean or how to do that.
FYI, I checked to make sure the http://staging.cudenvertoday.org/wp-admin/admin-ajax.php file is on the server, and it is.
Thanks for the tip… Here’s what I get after clicking the Save Template button:
POST http://staging.cudenvertoday.org/wp-admin/admin-ajax.php 400 (Bad Request) load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:5 send @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:5 m.extend.ajax @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:5 _alm_admin.saveRepeater @ admin.php?page=ajax-load-more-repeaters:429 (anonymous function) @ admin.php?page=ajax-load-more-repeaters:471 m.event.dispatch @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:4 r.handle @ load-scripts.php?c=1&load[]=jquery-core,jquery-migrate,utils&ver=4.4.2:4FYI, I’m experiencing the same problem on a staging site. There, I tried deleting the template code, and also tried replacing it with the default code, but neither would let me save the changes.
Thanks for your help!
Sure, here it is:
<div class="topnews-container more-news col-xs-12 col-sm-6 col-md-3 <?php if ( has_post_thumbnail()) { ?>yes-img"<?php } else { ?>no-img"<?php } ?>> <?php // Top Story Card ?> <div class="topstories-card"> <?php // Top News Image & Headline ?> <div class="topnews-img"> <div class="topnews-cat <?php if ( has_post_thumbnail()) { ?>whitecat"<?php } else { ?>blackcat"<?php } ?>> <?php $categories = get_the_category(); if ( ! empty( $categories ) ) { echo '<a href="' . esc_url( get_category_link( $categories[0]->term_id ) ) . '">' . esc_html( $categories[0]->name ) . '</a>'; }; ?> </div> <?php if ( has_post_thumbnail()) { ?> <div class="tn-img"><a href="<?php the_permalink(); ?>" class="entry-img"> <?php the_post_thumbnail( 'LatestNews-XSmall' ); ?> </a></div> <?php } ?> </div> <?php if ( !has_post_thumbnail()) { ?><div class="topnews-textbox"><div class="topnews-text"><?php } ?> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php if (strlen($post->post_title) > 40) { echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else { the_title(); } ?></a></h1> <div class="topnews-author"><?php the_author(); ?></div><div class="topnews-date"><?php echo get_the_date(); ?></div> <div class="topnews-excerpt col-md-8"> <?php if ( has_post_thumbnail()) { ?> <p class="short-excerpt"><?php echo get_excerpt(95); ?></p> <?php } else { ?> <p class="long-excerpt"><?php echo get_excerpt(180); ?></p> <?php } ?> </div> <?php if ( !has_post_thumbnail()) { ?></div></div><?php } ?> <?php // END Top News Image & Headline ?> <?php // Social Icons ?> <div class="topnews-social <?php if ( has_post_thumbnail()) { ?>"<?php } else { ?>no-img"<?php } ?>> <div class="topnews-social-group"> <div class="topnews-social-icons"> <div class="addthis_toolbox addthis_default_style topnews-share" data-url="<?php the_permalink(); ?>" data-title"<?php the_title(); ?>" > <a class="addthis_button_facebook" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_twitter" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_email" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> </div> </div> </div> </div> <?php // END Social Icons ?> </div> <?php // END Top Story Card ?> </div> <script language="javascript" type="text/javascript"> function initAddThis() { addthis.init('.addthis_toolbox') addthis.toolbox('.addthis_toolbox'); }; // After the DOM has loaded... initAddThis(); </script>Anyone going to respond??
It’s on a test site:
http://staging.cudenvertoday.org/new-find-articles/And yes, the JS is loading in the footer, after the ajax-load-more.min.js loads (which happens to load in the header.)
I’ve also tried adding the JS directly in the footer, but that didn’t work either.
Thanks for your help!
Forum: Plugins
In reply to: [WP Popular Posts] need stats from individual sites on network.When I check the db tables, I noticed only one set of WPP tables under my primary domain, cudenvertoday.org. I’m not seeing either of the WPP tables under the other site in the network, cuanschutztoday.org (which also happens to be a child theme of cudenvertoday.)
I’m afraid to flush the cache in the cuanschutztoday site because I don’t want it to remove the cache from cudenvertoday too.
BTW, you can view the most popular posts list at the footer of each of those sites.
I appreciate your help!
Thanks.
Forum: Plugins
In reply to: [WP Popular Posts] need stats from individual sites on network.Any help on this, please??
Forum: Plugins
In reply to: [WP Popular Posts] need stats from individual sites on network.To clarify:
I have siteA and siteB on the same WP multi-site network. SiteB is a child theme of siteA.I installed WPP in the network plugins, and can access the WPP setting from both siteA & siteB Settings menu.
But when I use the following code in my theme the results include the most popular posts from only site A.
<?php wpp_get_mostpopular('header="Most Popular"&post_html="<li><a href=\'{url}\'>{text_title}</a><br/>{views} views</li>"&rating=0&limit=4&range="monthly"&freshness=1&post_type="post"&title_length=50' ); ?>Plus, when I view the WPP stats screen on siteB, I get “Sorry. No data so far.” regardless of which time frame I view.
So I’m wondering what I need to do to get siteB to display popular post just for siteB, and likewise for siteA?
Thanks!
On a different note: Is it possible to sort and/or filter results after Load More results have loaded? For example, if I have 1K posts, but only 20 load within ALM, could I have a button in my sidebar that filters and/or sorts ALL 1K posts?
Added it to the js file, but no luck. Oddly, I was able to get one row of posts to show the share links when I:
A) Added this to the Repeater code:
<script language="javascript" type="text/javascript"> $( window ).load(function() { console.log("callback posts"); console.log( "window loaded" ); }); function initAddThis() { addthis.init() addthis.toolbox(); }; // After the DOM has loaded... initAddThis(); </script>B) And added ansychronous load (#async=1) to the AddThis js like this:
<script src="http://s7.addthis.com/js/300/addthis_widget.js#async=1" type="text/javascript"></script>But that removed the AddThis buttons from the rest of the page (all the post queried before Load This, plus it only loaded the AddThis icons to the first row after clicking the ‘Load More’ button. Subsequent clicks of ‘Load More’ didn’t load the AddThis icons.
I put that in the script in the footer, but still nothing. The browser console doesn’t log “callback posts” either. Any other ideas? Should the function be moved somewhere else?
<script language=”javascript” type=”text/javascript”>
$(document).ready(function() {
$.fn.almComplete = function(alm){
console.log(“callback posts”);
addthis.init();
addthis.toolbox();
};});
</script>
</body>Thanks for getting back to me. 🙂
Here’s a test page: http://cudenvertoday.org/test-page/
and here’s the repeater code I’m using:
<div class="topnews-container more-news tcol-xs-12 <?php if ( has_post_thumbnail()) { ?>yes-img<?php } ?> col-md-4 "> <?php // Top Story Card ?> <div class="topstories-card"> <?php // Top News Image & Headline ?> <div class="topnews-img"> <div class="topnews-cat <?php if ( has_post_thumbnail()) { ?>whitecat"<?php } else { ?>blackcat"<?php } ?>> <?php the_category();?> </div> <?php if ( has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?>" class="entry-img"> <?php the_post_thumbnail( 'LatestNews-Small' ); ?> </a> <?php } ?> </div> <?php if ( !has_post_thumbnail()) { ?><div class="topnews-textbox"><div class="topnews-text"><?php } ?> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php if (strlen($post->post_title) > 40) { echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else { the_title(); } ?></a></h1> <div class="topnews-author"><?php the_author(); ?></div><div class="topnews-date"><?php echo get_the_date(); ?></div> <div class="topnews-excerpt col-md-8"> <?php if ( has_post_thumbnail()) { ?> <p class="short-excerpt"><?php echo get_excerpt(95); ?></p> <?php } else { ?> <p class="long-excerpt"><?php echo get_excerpt(180); ?></p> <?php } ?> </div> <?php if ( !has_post_thumbnail()) { ?></div></div><?php } ?> <?php // END Top News Image & Headline ?> <?php // Social Icons ?> <div class="topnews-social <?php if ( has_post_thumbnail()) { ?>"<?php } else { ?>no-img"<?php } ?>> <div class="topnews-social-group"> <div class="topnews-social-icons"> <div class="topnews-ratings"> <?php if(function_exists('the_ratings')) { the_ratings(); } ?> </div> <div class="addthis_toolbox addthis_default_style topnews-share" style="margin-left:15px;" data-url="<?php the_permalink(); ?>" data-title"<?php the_title(); ?>" > <a class="addthis_button_facebook" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_twitter" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> <a class="addthis_button_email" addthis:url="<?php the_permalink(); ?>" addthis:title="<?php the_title(); ?>" ></a> </div> </div> </div> </div> <?php // END Social Icons ?> </div> <?php // END Top Story Card ?> </div>