Get terms of the posts with one query

You can use the following SQL query SELECT * FROM wp_posts a, wp_term_relationships b, wp_terms c WHERE a.post_status=”published” AND a.ID = b.object_id AND b.term_id = c.term_id; This will list all the post that is in the published state and then its terms. You can add limits and offsets to limit the number of records.

get_option return incorrect values

You can just use the get_option() function like this: <?php $main_dashboard_check = get_option( ‘main_dashboard_check’ ); var_dump( $main_dashboard_check ); /* outputs false if the value does not exist */ $main_dashboard_check = get_option( ‘main_dashboard_check’, ‘default_value’ ); var_dump( $main_dashboard_check ); /* outputs ‘default_value’ if the value does not exist */ ?>

Post formating on Home page

Yes, it is quite simple, you just need to work in PHP. Consider you have 36 posts in a loop. $div_html_1 = ”; $div_html_2 = ”; $div_html_3 = ”; $div_html_4 = ”; $div_html_5 = ”; $div_html_6 = ”; if ( have_posts() ) { while ( have_posts() ) { if( category of post == division 1 … Read more