What is This esc_html_e() i wordpress php?

It’s a combination of _e(), which echoes a translatable string, and esc_html() which is for outputting text so that the text is not interpreted as HTML. You would use it to prevent HTML being smuggled into a translation and breaking your markup or causing security issues. For example, if your theme had: _e( ‘My translatable … Read more

How to split a loop into multiple columns

Create Columns for your query and easy display In themes is probably more useful to have something that fits well into template tags and the loop. My first answer didn’t focus on that much. Additionally I thought it’s a bit too complicated for a quick adoption. An easier approach that popped into my mind was … Read more

How to check if I’m on the last page of posts?

The WP_Query object contains a max_num_pages field which contains how many pages of posts there are. You can compare the current page number with it. (This is how get_next_posts_link() does it.) global $wp_query; $current_page = $wp_query->get( ‘paged’ ); if ( ! $current_page ) { $current_page = 1; } if ( $current_page == $wp_query->max_num_pages ) { … Read more

Multiple WP_Query loops with Pagination

Yes, it can be done. The key is to make the format parameter different for the two queries: <!– Cats –> <div class=”animals”> <? $paged1 = isset( $_GET[‘paged1’] ) ? (int) $_GET[‘paged1’] : 1; $paged2 = isset( $_GET[‘paged2’] ) ? (int) $_GET[‘paged2’] : 1; // Custom Loop with Pagination 1 // http://codex.wordpress.org/Class_Reference/WP_Query#Usage $args1 = array( … Read more

How to get posts published between a date and today?

UPDATE December 23 2014 There is a better method using date_query property of WP_Query class: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘post_format’, ‘field’ => ‘slug’, ‘terms’ => array( ‘post-format-image’ ) ) ), ‘cat’ => ‘-173’, ‘post_status’ => ‘publish’, ‘date_query’ => array( ‘column’ => ‘post_date’, ‘after’ => ‘- 30 days’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)