-2
votes
0answers
15 views

Fire function when query_var is set?

I am using add_query_arg('foo', 'bar'); - and I would like to have a function fire when one of these specific query variables is set. Is this possible?
0
votes
1answer
21 views

Declaring a var, placing it in a query and using the output of the query?

So i'm wondering if it's possible to declare a variable that you'd place in a query to then use it in a update_post_meta function? This is how I tried to do it. First off I made a connection to ...
0
votes
0answers
31 views

Working with arrays/foreach statements - echo results? Addition operator w/foreach… multiplying?

I'm really struggling with this - I'm relatively new to PHP but I'm trying make this code that I've pulled together output a list of chapters sorted by user pageviews based on a user_meta field called ...
2
votes
1answer
113 views

Using Wordpress public query variables

Good morning. I am trying to query various Wordpress pages, using public query variables, for example http://dmkim1979.ru/?p=37 // single post http://dmkim1979.ru/?page_id=40 ...
0
votes
2answers
257 views

Passing parameters to a static front page

I have googled a lot, but so far haven't come close to a proper solution yet. I need help with passing parameters to the homepage of a WordPress website. Here's my setup / requirements: I use a page ...
0
votes
0answers
43 views

Displaying posts by year

I'm trying to display posts on the homepage from the current year only. I am using the following: <?php if ( is_front_page()) { ?> <?php $current_year = date('Y'); ?> <?php ...
0
votes
2answers
503 views

Wordpress loop: Display <div> if posts exist

In a single post template I am trying to output some header text in a <div> and display links to related posts in a <ul> if related posts exist (based on tags). If there are no posts, ...
1
vote
4answers
2k views

How to tell if $query_var isset?

I tired to use isset($queryvar) but that didnt work, so I implemented my own function qv_isset, but it runs into a problem when $ch is set to 0. $cls = get_query_var('cls'); $ch = ...