jdku
Forum Replies Created
-
Forum: Plugins
In reply to: [Toplytics] Results not as expected or as UA Query returnsthanks for the reply. So, that’s made things unexpected. I tried a few different ‘tops’ and a few different amounts and now there’s no results at “/wp-json/toplytics/results” but strangely on the front end it’s still bringing back the same, wrong, results as previous.
I don’t know if it makes a difference or not but I’m using the function to get the results on the front end:
if (function_exists('toplytics_get_results') && $UrlPostId >= 0) { $toplytics_args = array( 'period' => 'month', 'numberposts' => 5 ); $toplytics_results = toplytics_get_results($toplytics_args); }
then
if ($toplytics_results) { foreach ( $toplytics_results as $post_id => $post_views ) { echo "post id: " . $post_id . "<br>"; } }
Forum: Fixing WordPress
In reply to: Best Practice For Small LoopsHi esmi, ok cool thank you. I wasn’t sure what would be considered the best way to achieve it. A function is good for me! Thanks for your help.
Forum: Fixing WordPress
In reply to: Best Practice For Small LoopsHi esmi, just mean so that i can call it from the homepage or from a specific category template or a page or wherever I wanted really. re-usable might not be the correct word in this instance!
ThanksTurns out the plugin does already cater for this scenario, switching to V2 only will remove the yellow box, however it also stops any previous comments from showing (unless you always had V2 selected).
It’s basically because FB have updated how comment URLs are passed to them, see: https://www.iannpurugganan.com/2011/12/fix-specifying-explicit-href-facebook.html for an explanation.
Hopefully someone will figure out a way of removing the box and keeping previous comments!
I’ve got the same on two websites, only seems to be if there isn’t any comments on a post.
No doubt Facebook will have changed something once again and given no-one a heads up!Still having this issue with the numbers growing each day (now over 4,000).
Can see that, according to Webmaster Tools, each page is linked to from itself with /?comments=true at the end.
This is odd as commenting on the site is done via Facebook Comments for WordPress plugin, normal comments are switched off and visiting any post with /?comments=true at the end just shows the post as normal.
I’ve tried posting when logged in and out and I can’t get “/function.call-user-func-array” to appear anywhere.
OK, scrap that totally didn’t work. Deleted it, reinstalled and got an XID number but still does exactly the same thing…stumped!
Can server settings conflict? As the only difference now between the two installs are the servers they are on?
think i’ve spotted the problem. for some reason the XID hasn’t been generated on this install. that’s the only difference i can find between this install and another i have that works absolutely fine!
Forum: Fixing WordPress
In reply to: Movenext in loop without countingabsolute genius!! works like a charm thank you so much!
Forum: Fixing WordPress
In reply to: Movenext in loop without countingyeah, as i mentioned before, on reflection their completely un-needed I just haven’t got round to taking them out.
Within the parent category of ‘news’ there are 5 or so sub-categories, occasionally i want to say that a ‘news’ item is also a ‘sport’ item (another parent category).
However I don’t want the sport item to appear on the website front end under news, ONLY in the RSS feed (as this is picked up by some news agregator sites that send quite a bit of traffic).
But, if i just skip the ‘sport’ item (which is easily done) i’m left with a blank space (only 10 items are displaying on the front end before ‘previous’ and ‘next’ buttons appear), I want to be able to skip the ‘sport’ item on the front end but not have that blank space.
so if out of 12 items, 10 are news and 2 are sport, then the RSS feed will show them all, but the front end would just ignore the 2 sport and simply show 10 news items and not go over 2 pages.
probably haven’t explained it any better!Forum: Fixing WordPress
In reply to: Movenext in loop without countingok, full file (except for printing the stuff to the screen) is up on pastebin, think i’ve done it right: https://wordpress.pastebin.com/B5J7HD0r
Forum: Fixing WordPress
In reply to: Movenext in loop without countingHi all, sorry was busy over the weekend.
vtxyzzy – yes the posts from sport are still showing up and all the code is within the “loop.php” file which is called using the “get_template_part” call.
alchymyth – thanks the “category_not_in” looks like that might do it, i’ll have a try when i’ve chance later and let you know but it seems to be exactly what I’m after!Forum: Fixing WordPress
In reply to: Movenext in loop without countinghi, yes it is being executed. It isn’t necessary on reflection (though to get this work it probably would) but its in there and works, just probably not very efficient.
Forum: Fixing WordPress
In reply to: Movenext in loop without countinghi vtxyxxy,
thanks for your help, i managed to try this today and get an error:
Parse error: syntax error, unexpected ')' in C:\xampplite\htdocs\wordpress3-1\wp-content\themes\themename\loop.php on line 94
line 93,94 & 95 are:array('cat' => -55), ) );
if i take out the comma then the code compiles but it’s not taking the category away. full code is below if it helps, this is all in the loop.php file.
I probably haven’t explained things very well so i’ll try again. Basically i have a category (48=news) and (55=sport). In a nutshell i’m fudging my RSS feed, so i sometimes want ‘sport’ items to be in the ‘news’ RSS feed but ignored by the site front end. it may be easier to do it from the RSS side but I know less about RSS then i do about PHP (which is saying something!)<?php elseif (in_category(48)) : ?> <?php $c = 0 ; ?> <div id="container_division"> <?php global $wp_query; query_posts( array_merge( $wp_query->query, array('cat' => -55), ) ); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php $c++; if ($c == 1 or $c == 2 or $c == 5 or $c == 6 or $c == 9 or $c == 10) { $extra_class = 'Even'; } else { $extra_class = 'Odd'; } ?> <div class="post-block<?php echo $extra_class; ?>"> --output image, excerpt etc </div> </div> <?php endwhile; else: ?> <?php endif; ?> </div> <?php wp_reset_query() ?>
Forum: Fixing WordPress
In reply to: Movenext in loop without countingThanks vtxyzzy that’s what I’ve got but as you said, the potential is i could be left with a blank page. Is there no way to skip them but keep the number that i’m currently on so i don’t end up with a blank page?