Articles of comparison

Conditional string comparison failing for basename/slug

I am trying to display a particular block of html for one page in particular. I have created a conditional statement that compares the basename of the page to my string. <?php if ( has_tag( ‘Sponsor’ ) && basename( get_permalink() != ‘sponsor-one’) ) : // show sponsor’s footer if applicable ?> <div class=”sponsor-footer <?php echo […]

Conditional statement for dates

Im trying to create a conditional statement comparing two dates. I have a ACF custom date field as one date, and then comparing against the current date. Below is what i have and iv echoed both $date and $currentdate and they both come out in the same format, so im not sure why it wont […]

How to get events using multiple custom meta fields?

I need to grab a list of current events. The events have a start and end date so I need to be able to select a range as opposed to just getting any list of events that have an end date that is after today’s date. Does anyone have any suggestions as to how to […]

How to compare two posts including their meta fields on a scalable base?

I have set up a wordpress in a way that posts can be cloned and be altered by a different author. whenever this is the case, i want the administrator to be notified via an additional tab in the edit.php screen like Changes(5) where only posts are listed whose content and meta fields differ from […]

Is there a WordPress version that is incompatible with PHP 5.3?

Is there some decent information available which WordPress versions do not support PHP 5.3? I mean the more recent ones like 2.9 / 3.0 / 3.1? I’m only concerned about the WordPress core codebase, not plugins. I’ve run WP for most of the time on PHP 5.3 now. But some servers are still on PHP […]

WordPress or Drupal for data-heavy content site

Looking to build a very data-heavy content site and not sure if what I’m looking to do can be accomplished in WordPress (my preference) or even in Drupal for that matter. The problem isn’t the content, which I assume Custom Post Types (or maybe Pods??) could do. It’s the relationships between the content. Basically want […]

What are the advantages of WordPress over other systems?

I’ve tried to explain the benefits of WordPress to others; comparing it to static sites is easy, as (most) everything can be done online with WP. I have more difficulty comparing and contrasting with other content management systems such as Drupal. I realize that there is no perfect system for every use, but what features […]

Check to see if page exists problems

I’ve created a class to dynamically create pages. I’m checking to see if the page exists by comparing the new page’s title to post_name. The comparison seems to work ok, but even if there is a match the page is created anyway and I can’t figure out why. My code looks like this: class createDynamicPage […]

get_transient(), PHP switch(), and comparison operators

Im using a WordPress transient, which expires after an hour, to store a value which is an integer. Im trying to use switch() and multiple case() statements to evaluate if the transient exists or not (i.e true or false). Here are my questions: Which comparison operator (=, ==, ===), in example 2, is ideal for […]

How to handle optional end date in compare clause in meta_query

I have a custom post type event in WordPress, and I need to query upcoming event posts comparing $current_date. Query conditions are : start_date is a valid date always end_date can be a valid date or null or empty string. IF end_date is a valid date in db record then compare end_date >= $current_date ELSE […]