Theme file structure best practice

You first need to ask yourself: Will this theme ever be maintained or used by other people than me? If so, read on, if not, you should only build code that will eventually make sense to you when getting back to this project after a few years. If you are creating a theme that will … Read more

Creating a copy of a website in a subdirectory, wp-admin redirect problem

If it’s a standard WordPress .htaccess file that won’t be your problem. I’m willing to bet you forgot to change the Site URL values when you imported the database. You can either edit it in the options table in your database or even in your wp-config file by adding define(‘WP_HOME’, ‘http://mainwebsite.com/test’); define(‘WP_SITEURL’, ‘http://mainwebsite.com/test’); to it. … Read more

How can I say if a URL is a post, page, or taxonomy archive?

WordPress sites usually use body_class(), which adds CSS classes to the <body> tag. If you inspect the body element itself, most sites will show you something like <body class=”page-template page-template-tpl-events page-template-tpl-events-php page page-id-1168 page-parent page-child parent-pageid-378″> You can tell from these classes that this is a Page, using a Page Template, it is a Parent, … Read more

Use of Folders within WordPress

There are no “folders” in the CMS as the content is stored in a set of database tables, unless your site is created with the content inside the templates and not the content editor. A parent -> child page structure is possible and easy to organize. Simply assign the second level pages to a common … Read more

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