Daily posts like an archive

The function wp_get_archives as far as I know this will only output a list. Instead use the WordPress loop and WP Query’s Date parameters. For example to get yesterdays posts using WP_Query you can do something like: $yesterday = date(‘d.m.Y’,strtotime(“yesterday”)); $yesterdayarray = date_parse($yesterday); $query = new WP_Query( ‘&day=’ . $yesterdayarray[“day”] ); // grab the data … Read more

Show results for multiple page-types

You should use ‘meta_query’ instead it is a array of arrays $product_pages_args = array( ‘meta_query’ => array( array( ‘key’ => ‘_wp_page_template’, ‘value’ => array(‘page_library_html_content.php’,page_library_css_content.php’) , ‘compare’ => ‘IN’ ), ) )

Get null from POST

Please show Your html form code. Also i think you have an error in $wpdb->insert statment. Should be: $wpdb->insert(wp_ow_odczyty, array($data));

use advance custom field inside query post command [closed]

When you do this: <?php query_posts(‘category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5′); ?> The string argument is literally category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5. Well, it would be if the string were not also triggering a fatal error. What you have is (assuming I haven’t lost track of the mess): String 1: ‘category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5′ An undefined constant: cat_1_name An out of … Read more

Stop loading more posts if none left AJAX

Yes use wp_query 🙂 Anyway, to prevent loading posts while you’re out of pages, you need to know the current page number last loaded and the total number of pages that exist. Total pages that exist: $max = $wp_query->max_num_pages; Current page: just count it in your load loop, so set the var to 1, then … Read more

Dynamically adding Captions to images

The media uploader wraps the image and caption in the shortcode. There is a filter called img_caption_shortcode that can do what you want. The caption itself is passed as part of an array to the shortcode handler, as is the image id. add_filter( ‘img_caption_shortcode’, ‘wwm_img_caption_filter’, 10, 3 ); function wwm_img_caption_filter( $empty, $attr, $content ) { … Read more