wyclef
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to create simple add to calendar text link?I see. The calendar date would be based on a date entered via a custom date field in WP post.
Forum: Plugins
In reply to: [IP Location Block] Local database settings failed to copy@darkog are there any updates on any of this?
Forum: Fixing WordPress
In reply to: How can I add a class name to one image tagRight. I think I might try to hook this class outside of the image tag via the body class or something else where I may be able to avoid even needing this class on the image tag. If that doesn’t work guess I’ll just roll with the if statement.
I am not sure if this is a problem anymore. It may have just been a one time thing.
Forum: Plugins
In reply to: [IP Location Block] Local database settings failed to copyWondering if there is any progress on this?
Forum: Fixing WordPress
In reply to: How can I add a class name to one image tagYea, seems like I might need an if statement. This is only on one page I think, how would I hook it to a specific page? Like, I would just put the if statement with the two different returns?
Forum: Developing with WordPress
In reply to: Help with no upcoming event scheduled textPerfect. Thanks! Relying on $showCounter is very simple.
Forum: Developing with WordPress
In reply to: Help with no upcoming event scheduled textOk, I think we were on the right track I was maybe just looking at the wrong if statement.
Got this to work does it look alright?Nevermind, only seems to show the else now regardless if upcoming post is published.// Display Events function getLandingEvents() { global $post; $eventsArray = array(); $dateArray = array(); $counter = 0; $postHTML = '<div class="events-list">'; $args = array('category_name' => 'events'); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); $dateArray[] = array('date' => get_field('date', $post->ID), 'pid' => $post->ID); $counter++; endwhile; endif; foreach ($dateArray as $key => $row) { $dateTemp[$key] = $row['date']; $pidTemp[$key] = $row['pid']; } array_multisort($dateTemp, SORT_ASC, $pidTemp, SORT_ASC, $dateArray); $today = date('Ymd'); $showCounter = 0; for ($i = 0; $i < count($dateArray); $i++) { $currentDay = new DateTime($today); $eventDate = new DateTime($dateArray[$i]['date']); $interval = $currentDay->diff($eventDate); if (($interval->format('%R') == '+') && ($interval->format('%a') <= 60) && $showCounter < 3) { $categories = get_the_category($dateArray[$i]['pid']); $slug = trim($categories[0]->slug); if (get_field('date', $dateArray[$i]['pid']) != '') { $date = DateTime::createFromFormat('Ymd', get_field('date', $dateArray[$i]['pid'])); $mainDate = $date->format('M dS'); $month = $date->format('n'); $day = $date->format('j'); $simpleDate = $date->format('Y-m-d'); } $postHTML .= '<div class="event">'; $postHTML .= '<a href="'.get_permalink($dateArray[$i]['pid']).'">'; $postHTML .= '<time datetime="'.$simpleDate.'">'.$month.'/'.$day.'</time>'; $postHTML .= '<div class="text-holder">'; if ($categories[0]->parent != 0) { $childCatName = trim($categories[0]->name); $postHTML .= '<h2>'.$childCatName.'</h2>'; } $postHTML .= '<p><strong>'.get_the_title($dateArray[$i]['pid']).'</strong></p>'; $postHTML .= '<h3>'.get_field('event-subheading', $dateArray[$i]['pid']).'</h3>'; $postHTML .= '<div class="info">'; $postHTML .= '<p>Thursday, <time datetime="'.$simpleDate.'">'.$mainDate.', '.get_field('time', $dateArray[$i]['pid']).'</time></p>'; if (get_field('location', $dateArray[$i]['pid']) != '') { $postHTML .= '<p>'.get_field('location', $dateArray[$i]['pid']).'</p>'; } $postHTML .= '</div>'; $postHTML .= '</div>'; $postHTML .= '</a>'; $postHTML .= '</div>'; $showCounter++; } else { $postHTML .= '<div class="event"><div class="text-holder"><h3>Check back soon for next semester’s events!</h3></div></div>'; break; } } $postHTML .= '</div>'; return $postHTML; }Forum: Developing with WordPress
In reply to: Help with no upcoming event scheduled textHmmm, not getting anything. Not breaking anything, just not showing the return. Do I have this return correct?
// Display Events function getLandingEvents() { global $post; $eventsArray = array(); $dateArray = array(); $counter = 0; $postHTML = '<div class="events-list">'; $args = array('category_name' => 'events'); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); $dateArray[] = array('date' => get_field('date', $post->ID), 'pid' => $post->ID); $counter++; endwhile; else : return '<h3>Check back soon for next semester’s events!</h3>'; endif; foreach ($dateArray as $key => $row) { $dateTemp[$key] = $row['date']; $pidTemp[$key] = $row['pid']; } array_multisort($dateTemp, SORT_ASC, $pidTemp, SORT_ASC, $dateArray); $today = date('Ymd'); $showCounter = 0; for ($i = 0; $i < count($dateArray); $i++) { $currentDay = new DateTime($today); $eventDate = new DateTime($dateArray[$i]['date']); $interval = $currentDay->diff($eventDate); if (($interval->format('%R') == '+') && ($interval->format('%a') <= 60) && $showCounter < 3) { $categories = get_the_category($dateArray[$i]['pid']); $slug = trim($categories[0]->slug); if (get_field('date', $dateArray[$i]['pid']) != '') { $date = DateTime::createFromFormat('Ymd', get_field('date', $dateArray[$i]['pid'])); $mainDate = $date->format('M dS'); $month = $date->format('n'); $day = $date->format('j'); $simpleDate = $date->format('Y-m-d'); } $postHTML .= '<div class="event">'; $postHTML .= '<a href="'.get_permalink($dateArray[$i]['pid']).'">'; $postHTML .= '<time datetime="'.$simpleDate.'">'.$month.'/'.$day.'</time>'; $postHTML .= '<div class="text-holder">'; if ($categories[0]->parent != 0) { $childCatName = trim($categories[0]->name); $postHTML .= '<h2>'.$childCatName.'</h2>'; } $postHTML .= '<p><strong>'.get_the_title($dateArray[$i]['pid']).'</strong></p>'; $postHTML .= '<h3>'.get_field('event-subheading', $dateArray[$i]['pid']).'</h3>'; $postHTML .= '<div class="info">'; $postHTML .= '<p>Thursday, <time datetime="'.$simpleDate.'">'.$mainDate.', '.get_field('time', $dateArray[$i]['pid']).'</time></p>'; if (get_field('location', $dateArray[$i]['pid']) != '') { $postHTML .= '<p>'.get_field('location', $dateArray[$i]['pid']).'</p>'; } $postHTML .= '</div>'; $postHTML .= '</div>'; $postHTML .= '</a>'; $postHTML .= '</div>'; $showCounter++; } } $postHTML .= '</div>'; return $postHTML; }Forum: Developing with WordPress
In reply to: Help with no upcoming event scheduled textThanks for your reply. Does this look right to you, it doesn’t seem to do anything.
// Display Events function getLandingEvents() { global $post; $eventsArray = array(); $dateArray = array(); $counter = 0; $postHTML = '<div class="events-list">'; $args = array('category_name' => 'events'); query_posts($args); if ( have_posts() ) : while ( have_posts() ) : the_post(); $dateArray[] = array('date' => get_field('date', $post->ID), 'pid' => $post->ID); $counter++; endwhile; else : $postHTML .= '<h3>Check back soon for next semester’s events!</h3>'; endif; foreach ($dateArray as $key => $row) { $dateTemp[$key] = $row['date']; $pidTemp[$key] = $row['pid']; } array_multisort($dateTemp, SORT_ASC, $pidTemp, SORT_ASC, $dateArray); $today = date('Ymd'); $showCounter = 0; for ($i = 0; $i < count($dateArray); $i++) { $currentDay = new DateTime($today); $eventDate = new DateTime($dateArray[$i]['date']); $interval = $currentDay->diff($eventDate); if (($interval->format('%R') == '+') && ($interval->format('%a') <= 60) && $showCounter < 3) { $categories = get_the_category($dateArray[$i]['pid']); $slug = trim($categories[0]->slug); if (get_field('date', $dateArray[$i]['pid']) != '') { $date = DateTime::createFromFormat('Ymd', get_field('date', $dateArray[$i]['pid'])); $mainDate = $date->format('M dS'); $month = $date->format('n'); $day = $date->format('j'); $simpleDate = $date->format('Y-m-d'); } $postHTML .= '<div class="event">'; $postHTML .= '<a href="'.get_permalink($dateArray[$i]['pid']).'">'; $postHTML .= '<time datetime="'.$simpleDate.'">'.$month.'/'.$day.'</time>'; $postHTML .= '<div class="text-holder">'; if ($categories[0]->parent != 0) { $childCatName = trim($categories[0]->name); $postHTML .= '<h2>'.$childCatName.'</h2>'; } $postHTML .= '<p><strong>'.get_the_title($dateArray[$i]['pid']).'</strong></p>'; $postHTML .= '<h3>'.get_field('event-subheading', $dateArray[$i]['pid']).'</h3>'; $postHTML .= '<div class="info">'; $postHTML .= '<p>Thursday, <time datetime="'.$simpleDate.'">'.$mainDate.', '.get_field('time', $dateArray[$i]['pid']).'</time></p>'; if (get_field('location', $dateArray[$i]['pid']) != '') { $postHTML .= '<p>'.get_field('location', $dateArray[$i]['pid']).'</p>'; } $postHTML .= '</div>'; $postHTML .= '</div>'; $postHTML .= '</a>'; $postHTML .= '</div>'; $showCounter++; } } $postHTML .= '</div>'; return $postHTML; }Forum: Developing with WordPress
In reply to: How to limit tag countNever mind, just had the count and count++ mixed up here is the working code.
function pastLectures() { $args = array('order' => 'DESC'); $posttags = get_tags($args); $count = 0; $tags = ''; $tags .= '<ul>'; if ($posttags) { foreach($posttags as $tag) { //print_r($tag); $tempYear = substr($tag->slug, 0, 4); $pastLecturesYes = get_field('add-to-past-lecture-series', 'post_tag_'.$tag->term_id); if ($pastLecturesYes[0] == 'add') { $count++; $tagLink = get_tag_link($tag->term_id); $tags .= '<li><a href="'.$tagLink.'"> '.$tag->name.'</a></li>'; if( $count > 4 ) break; } } } $tags .= '</ul>'; return $tags; }Forum: Developing with WordPress
In reply to: How to limit tag countTrying to just limit the count to 5 on the working chunk of code. Thinking I am just missing something simple here.
Forum: Plugins
In reply to: [IP Location Block] Local database settings failed to copy@darkog emailed you my diagnostic information.
Forum: Plugins
In reply to: [IP Location Block] Local database settings failed to copyYes
Forum: Plugins
In reply to: [IP Location Block] Local database settings failed to copycould deactivating IP Geo Block and not uninstalling cause a conflict here?