Now your data is formatted in array with key as display text and value as custom field content
array(
'Display text' => 'Custom field content',
'...' => '...',
'...' => '...',
'...' => '...',
)
Category: PHP
Add following code to your functions.php
Added variable can be found in i18n
object.
$wp_query->post_count
contains number of posts being displayed.
$wp_query->found_posts
contains total number of posts found with current criteria.
Local variables are not available in get_template_part()
templates.
Instead of using global variables, template can be included with locate_template()
function and all your variables will be available in the template file.
Add following code to your functions.php.
$query->set( 'posts_per_page', -1 );
shows all posts.
Above example does not work in Page requests, use query_posts()
instead.
To get current url in WordPress with arguments use the following function.
Returned array contains values for url (0), width (1), height (2) and scale (3).
Select posts where custom field wpcf-start-date
is larger or equal as current date.
Add the following snippet to your themes functions.php file.
Add following snippet to your themes functions.php