Pagination for multiple queries merging into one Loop

Firstly you need to merge your two query into one, and need to use WP_Query instead of get_posts: $paged = 1 ; $posts_per_page = 10 ; $args = array( ‘post_type’ => ‘espresso_event’, ‘meta_key’ => ‘event_start_date’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘posts_per_page’ => $posts_per_page, ‘paged’ => $paged, ‘meta_query’ => array( array( ‘key’ => ‘event_registration_end’, ‘value’ … Read more

Redirect to current user page upon link click

Thank you so much for the responses. Using both of the ideas received I started to play a little with the code, although I was not sure what to do with them. I came up with a solution that works very well for me, I created a new template in my theme called ‘redirect.php’. At … Read more

Theme Functions run a function upon activation or preview

Try if ( isset($_GET[‘activated’]) && $_GET[‘activated’] == ‘true’ || isset($_GET[‘preview’]) && $_GET[‘preview’] == 1 ) instead of if ( $_GET[‘activated’] == ‘true’ || $_GET[‘preview’] == 1 ) Edit: You should wrap the if-sentence in the functions.php file into a function and a relevant hook. Here is an example using the after_theme_setup hook: add_action(‘after_theme_setup’,’my_theme_setup’); function my_theme_setup(){ … Read more

Kohana Frontend, WordPress Backend

You could add the Kohana part as a WordPress plugin that filters template_include and returns a local file path to your Kohana controller. Then you all the regular WordPress variables and functions are available in your additional code. If you want to use your own database layer you’d have to do the rewrite part probably … Read more

Creating on-page options for Custom Post Type

What you want is a custom meta box. Searching this site will give you plenty of examples as well, but here’s a brief run down. You hook into add_meta_boxes and call, appropriately, add_meta_box. <?php add_action(‘add_meta_boxes’, ‘wpse87567_add_box’); function wpse87567_add_box($post_type) { // $post_type the “page” on which the `add_meta_boxes` action is being fired // It could be … Read more

WordPress Rewrite Rule

As the question was modified, I modify my answer. This task is relatively easy, doable just with a single rewrite rule, which converts everything after /mypage/ string into a variable – I call it var. As this is added to query_vars via hook, is reachable via global $wp_query; echo $wp_query->var;. add_filter( ‘query_vars’, ‘binda_query_vars’ ); function … Read more