What content to use for inserting images

Images (and other media) in WordPress are stores as attachments — which are a special native post type (more or less). There are two common ways to display attachments in a post context: Include them in post content (individually or via gallery shortcode) Select one as featured image (aka post thumbnail) and have theme with … Read more

wp-cli for Creating page-template

wp-cli is not a development tool, it is a server admin tool, as such all the scaffold stuff there is…. for lack of better word, unneeded bloat. It is unlikely to reflect best practice, especially if your copy is old. In the specific case of page templates, there is really nothing worth “scaffolding” the easiest … Read more

wp_redirect goes to infinity loop

Us this code instead: function redirect_location(){ global $wp; $current_url = home_url( $wp->request ); $UserDetails = unserialize(file_get_contents( ‘http://www.geoplugin.net/php.gp?ip=’ ) ); $userCountry = $UserDetails[‘geoplugin_countryCode’]; if($userCountry == ‘AR’){ $url = home_url(‘/ar/’); } else if($userCountry == ‘FR’){ $url = home_url(‘/fr/’); } else { $url = home_url(‘/in/’); } if( ( is_page() || is_home() ) && ( strpos( $current_url, $url ) … Read more

What is wrong with my page.php?

if i understand right the problem is that you assign a static $page_id = 98; so no matter what page you go to it will only display that page’s content. what you need is to use the WordPress loop so change your code to this <!– Start Page Content –> <h1 class=”blog-title”><?php the_title(); ?></h1> <?php … Read more