How to use PHP code with wordpress page

The best way to create dynamic data outputs really depends on the what, why, and how. For example, if you’re creating a theme that creates its own custom post type, say, to store information about the head honchos that run the business behind the site, then just create a “single-$CPTNAME.php” template that has the code … Read more

Auto Linking Words But Only One Time

Can’t you pass limit number of replacements in str_replace? Like that $text = str_replace(array_keys($replace), $replace, $text, 1); EDIT: Sorry I was thinking about something else and missed this one. You can use preg_replace and set limit in it. Like this one. function wp_affiliate_links($text){ $replace = array( ‘/ nursery rhymes /’ => ‘ <a href=”http://www.nurseryrhymes.me/”>nursery rhymes</a> … Read more

Moving site made easier

For the specific settings you are asking about you can hardcode the values into your wp-config.php file(s): define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); These values will be used and database values will be ignored and not editable in settings. Note that there are plenty more places that might store URLs, such as images in content and so on. There … Read more