Search results

  1. W

    PHP PHP 8 Fatal Error

    or function orderByDate($items) { //$tempDate = strtotime($item); $referenceArray = array(); for ($i = 0; $i < (is_countable($items) ? count($items) : 0); $i++) { $referenceArray[] = strtotime($items[$i]['pubDate']); } array_multisort($referenceArray, SORT_DESC...
  2. W

    PHP PHP 8 Fatal Error

    So like an if $items isset around the for, else return?
  3. W

    PHP PHP 8 Fatal Error

    Hi, I am getting a fatal error of PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in... on the following count line when upgrading from PHP 7.4 to PHP 8: function orderByDate($items) { //$tempDate = strtotime($item)...
  4. W

    PHP Undefined Array Key Help

    Would that just be added to the foreach line after => $row?
  5. W

    PHP A non-numeric value encountered Warning

    Hi, I am getting a non-numeric value encountered warning on the line with the + in PHP 7.4. If I change the following from // Color picker case "color": $default_color = ''; if ( isset($value['std']) ) { if (...
  6. W

    PHP Undefined Array Key Help

    Hi, I am getting a PHP Warning of undefined array key on the following line. Wondering how I can adjust this function to get the warning to go away? $rows[$key] = $row['id']; which is inside the following function function getWorkingPapers() { if(get_field('working-papers'...
  7. W

    PHP PHP/WP problem with code, trouble accessing custom archive links

    I do see a 301 when trying to go to the year. /2021,/2020,etc. $_SERVER['REQUEST_URI']) only returns /news/newsletter/
  8. W

    PHP PHP/WP problem with code, trouble accessing custom archive links

    Seems like this worked back in WP 5.4 and then broke in WP 5.5. Found this which seems related although I don't see I am using 'paged'. https://core.trac.wordpress.org/ticket/50976
  9. W

    PHP PHP/WP problem with code, trouble accessing custom archive links

    Hello, I have an old custom WP site that was working fine running PHP 7.3.9 and WP 4.9.18 and since upgrading to PHP 7.4.21 and WP 5.6.10 the archive links by year to access older data are no longer doing anything other than reloading the same page. I was wondering if someone might be able to...
  10. W

    JavaScript How to triple nest quotes in JS?

    I think in the newer versions of jQuery that # sign needs "" or '' around it but since there are already "" next to it I am unclear how to format it.
  11. W

    JavaScript How to triple nest quotes in JS?

    Hi, how can I triple nest quotes so jQuery(".navigation a[href*=#"+rnrSection+"]").parent().addClass("active"); has quotes around the # sign? I am getting an Uncaught Error: Syntax error, unrecognized expression: .navigation a[href*=#”+rnrSection+”] that I think has to do with that.
  12. W

    PHP PHP events not showing when date is today.

    Hi, I have some old PHP code I am trying to sort through and it is for pulling 3 upcoming events and I guess it was written so todays event doesn't show and am trying to fix that. I was wondering if anyone can make sense of this? <ul> <?php $urlSplits =...
  13. W

    PHP RSS Feed aggregation changing date to todays date everytime feed is aggregated

    Actually found the original documentation via the Wayback Machine > https://web.archive.org/web/20191228101238/http://rssphp.net
  14. W

    PHP RSS Feed aggregation changing date to todays date everytime feed is aggregated

    Hey, was wondering if someone might be able to rummage through the following and provide some insight as to why this custom RSS feed aggregation code is returning the current date and not the actual pub date? The key variable here is $cleanDate I believe. This is using some older RSS aggregation...
  15. W

    PHP How do I limit the for loop count?

    I think this? // read feed from xml function xmlFeed($section) { $rss = new rss_php; $feedURL = site_url().'/'.$section.'.xml'; $rss->load($feedURL); return $rss->getItems(); } Can I just add something to the first snippet like for ($i = 0; $i < count($items) < 12; $i++) { or...
  16. W

    PHP How do I limit the for loop count?

    Hi, limit the number of feed posts pulled into the output. Now it just pulls unlimited.
  17. W

    PHP How do I limit the for loop count?

    Hi, the following works fine but I’d like to limit the max number of items pulled at a given time? Wondering how to do this? function rssNews() { $items = xmlFeed('research'); $items = orderByDate($items); $output = ''; $output = '<ul id="rssnews">'; if (count($items) >= 2)...
  18. W

    JavaScript Uncaught TypeError using hammer.js

    Hey, I am working on an old site that was using hammer.js v1.0.5 (https://hammerjs.github.io/) and jQuery 1.8.3. I am currently trying to upgrade hammer to the newest version (v2.0.8 > https://hammerjs.github.io/dist/hammer.min.js) and jQuery 1.12.4 w/ Migrate and am getting an Uncaught...
  19. W

    PHP WordPress/Advanced Custom Fields/ PHP Rand

    Took out $paperCounter for now to try and get 1 random one pulled and have it functioning with the exception of the get_image_with_alt line. Any clue how I could pull 2 randoms, and adjust that line? Feel like I am getting close but need a bit of help. function getLatestPhotos() {...
  20. W

    PHP WordPress/Advanced Custom Fields/ PHP Rand

    Hey, I have this PHP/ACF code for WP that pulls the latest 2 entries and am wondering how to adjust this so it would just pull random entries instead. Thanks! function getLatestPhotos() { if(get_field('photos', 34)) { $latestPhotos = '<ul class="photo-list">'; $paperCounter...
Top Bottom