Questions tagged [comparison]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

Comparing two dates (ACF and current time)

I’m trying to compare two dates (the current date with an ACF datepicker one) to display specific content. What I’m trying to achieve is to display a phrase if the ACF date is lower than the current ...
0
votes
1answer
26 views

PHP question: how to combine syntax?

could someone please tell me where the mistake is in my PHP code? My PHP knowledge is extremely rudimentary although I have tried it with http://php.net/manual/de/language.operators.logical.php :-D "...
1
vote
2answers
69 views

Comparing between a negative and positive number

I'm having some difficulty comparing between a negative and positive number. This code works fine when it's between two positive numbers but not when it's between a negative then a positive one. This ...
5
votes
5answers
2k views

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 ...
0
votes
1answer
2k views

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 ...
0
votes
1answer
61 views

Compare date of user's last posts

I want to compare the date of a user's last two posts. I'm new to WordPress developing. I have written this code but I'm not sure if it's correct. Please help me in correcting it: $ID ...
0
votes
1answer
143 views

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( '...
0
votes
1answer
629 views

Get previous posts list

I'll give up. Have searched and searched and tried and tried... Can't find any solution to list previous posts. On a single post: I want to show a list of the 10 previous posts, the 10 before the ...
0
votes
0answers
718 views

WP_Query using meta_query with LIKE doesn't return what it should

I am using this code to get stuff based on my custom field and custom content type. $searchTerm = 'bestafricanvideos'; $args = array( 'post_type' => 'sitemaps', 'posts_per_page' => -1, ...
0
votes
1answer
67 views

Comparison operator

I've build a dropdown box with a list of comparison strings. array( 'value' => array( __( 'Equal', 'js_composer' ) => '=', __( 'Does not equal', 'js_composer' ) =...
0
votes
1answer
197 views

Filter posts/pages by user_role array

I have made a code for to filter wich pages to show depending on your user_role. Everything was alright. But my customer created NEW roles with similars name/slug. So now, if some 1 have the role ...
1
vote
0answers
254 views

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....
0
votes
1answer
142 views

How to display checked posts on another page over AJAX? (like comparasion style)

I wanted to create an "comparasion" model for my WordPress Website, but gone bad at that. I cannot figure out how to ... On one page I have displayed post (custom post type, ex. "Products"). Next to ...
0
votes
1answer
104 views

About WP's save_post action

Quick question, in API's some times save_post is used(most of the time actually). Is save_post the equivalent of the query action INSERT INTO whereas save_post saves metadata and forces Wordpress to ...
0
votes
1answer
119 views

Custom Post Type or Shortcode, What to choose? [closed]

While developing a multipupose theme for mass audience, i’m facing an issue. I’m going to code staff listing section. Now i was wondering, what should i do? 1: Create dedicated Custom Post Type for ...
6
votes
2answers
8k views

What is the difference between get_page_link and get_permalink functions?

Both functions return permalink to the post or page by it's ID. What are the differences and which of these functions should I use in which cases?
0
votes
1answer
317 views

Comparing Time with the_time();

I am trying to make a function that will check the time associated with a future event (cpt) with the current time, to see if the event has past. When I first collect the time it is in seconds and I ...
1
vote
3answers
320 views

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 ...
2
votes
2answers
1k views

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 ...
1
vote
1answer
2k views

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 ...
2
votes
3answers
2k views

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 (...
0
votes
1answer
129 views

Deactivate plugin on registration

I'd like to check if the server is running PHP5.2. To do this, I use a activation-hook which will be registered with "register_activation_hook". Instead of just returning a warning, i'd like to auto-...
-2
votes
2answers
302 views

How customizable is a self-hosted WordPress blog compared to a Blogger blog?

I currently have a Blogspot blog and I'm thinking of making the leap to a self-hosted WordPress one instead. Everything I've seems to suggest this is the best way to go for the best possible ...
0
votes
2answers
361 views

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 ...
1
vote
3answers
311 views

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 ...