Automatically generate pages from SQL

Use a shell script and WP-CLI in your SSH console. Your shell script has to fetch each element of your table and launch the function of WP-CLI that creates a post in WordPress. You can even provide a sort of template in the call of the function. WP-CLI is a useful tool, but you can … Read more

How to rewrite a page url

You can change page URL from the page editor. If you want to make changes for all the pages. You can go to settings -> general settings -> permalink and change it to your desired value. To change for a single page, modify your .htaccess : <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f … Read more

Using page-something.php as static front page

Use ‘front-page.php’ for your template. You can read more about it at https://codex.wordpress.org/Creating_a_Static_Front_Page Or create a page template that you set in the editor. This will allow you to set it on any page and you’re not tied to the ID. https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/ <?php /* Template Name: Example Template */ ?>

Dynamic page with comments

You probably can hack comments in somehow, but don’t. Create a custom post type for your musicians using register_post_type() and including “comments” support. You can then create post type templates to customize the display: archive-{post_type}.php — for archives single-{post_type}.php — and for single posts https://codex.wordpress.org/Post_Type_Templates Comments should now work properly without your having to hack … Read more

How to properly enable comments form in page template

I think it could be a problem with get_comments_number which returns numeric, though theoretically it should test this way too… you could try instead: if ( comments_open() || have_comments() ) : comments_template(); endif; OR if ( comments_open() || (get_comments_number() > 0) ) : comments_template(); endif;

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