How to move all theme templates into a subfolder WP

Not easy to do. You can create redirect template and assign templates based on page ID <?php if (is_page(‘629’)) { include(TEMPLATEPATH . ‘/pages/homepage.php’);} elseif (is_page(‘186’)) { include(TEMPLATEPATH . ‘/pages/generalpage.php’);} else { include(TEMPLATEPATH . ‘/pages/defaultpage.php’); } ?> See this for more details

Why does this snippet in a blog post make WordPress crash?

And of course after I ask the question, I find the solution… Apparently it’s caused by a trigger happy Mod_Security. WordPress: 503 Service Temporarily Unavailable when Posting New Posts or Modifying Existing Posts Adding these lines to the .htaccess file makes it go away nicely: <IfModule mod_security.c> SetEnvIfNoCase Request_URI ^/wp-admin/(?:post|async-upload)\.php$ MODSEC_ENABLE=Off SetEnvIfNoCase Request_URI ^/xmlrpc\.php$ MODSEC_ENABLE=Off … Read more

How to make number of blog posts a custom field?

It might actually still work, but the syntax is currently wrong (you have a PHP opening tag inside another opening tag). And you can assign the value of the custom field to a variable using the get_field function. What if you try this? <?php // assuming your ACF name is ‘number_of_posts’ $numposts = get_field(‘number_of_posts’); $args … Read more

Displaying Latest Posts on a Page

You can modify your post template (usually index.php, but depends on your theme) to: check if the current request should response those posts add a segment which will query the database to retrieve the posts you wish echo the post title and excerpt as you wish The following code will query the database and return … Read more

Why is my Blog Page ID == First Post ID?

the ‘posts page’ ID when using a static front page and a different posts page is: get_option( ‘page_for_posts’ ) in some context: if( is_home() && get_option( ‘page_for_posts’ ) ) { $page_ID = get_option( ‘page_for_posts’ ); }

Split Blog Into Two Sections?

My first thought was to create 2 main categories. Exclude one from the wordpress loop on index.php and then only show that category on a different page. The only problem with this method is that the users would have to make sure they are posting in the correct category. However if you used a plugin … Read more

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