regular expression syntax in php

Example Description ‘/hello/’ It will match the word hello ‘/^hello/’ It will match hello at the start of a string. Possible matches are hello or helloworld, but not worldhello ‘/hello$/’ It will match hello at the end of a string. ‘/he.o/’ It will match any character between he and o. Possible matches are helo or […]

get_posts() with Taxonomy

$args = array( ‘post_type’ => ‘POST_TYPE’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘TAXONOMY_NAME’, ‘field’ => ‘slug’, ‘terms’ => array( ‘YOUR_TERMS’ ), ‘operator’ => ‘AND’ ) ) ); get_posts( $args ); for more information refer the link http://codex.wordpress.org/Function_Reference/WP_Query#Taxonomy_Parameters

Do Not ORDER BY RAND()

If you really need random rows out of your results, there are much better ways of doing it. Granted it takes additional code, but you will prevent a bottleneck that gets exponentially worse as your data grows. The problem is, MySQL will have to perform RAND() operation (which takes processing power) for every single row […]

Media Screen Sizes for Standard Devices

/* Smartphones (portrait and landscape) ———– */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) { /* Styles */ } /* Smartphones (landscape) ———– */ @media only screen and (min-width : 321px) { /* Styles */ } /* Smartphones (portrait) ———– */ @media only screen and (max-width : 320px) { /* Styles […]

How to create posts under the post

I have created plugin to create a post under the post but this will work only with custom post type and custom taxonomy what i have created with this plugin. Plugin url wordpress.org/plugins/add-sub-posts