Can I create a page template, use it once, then hide/remove the option to use it again?

If a page won’t work without a specific template, I would just remove the need for them to select a template. Filter template_include and select the template based on the requested page: function wpse50455_template_include( $template ) { // check if it’s a page if ( is_page() ): $this_page_id = get_query_var( ‘page_id’ ); // check for … Read more

Getting page ID inside loop

You can use all template tags inside this file, so to get the ID, just use get_the_ID() (or the_ID() to output it). get_the_ID() will retrieve the numeric ID of the current post. It has no parameters and returns the ID of the current post. the_ID() will display the numeric ID of the current post. It … Read more

Front End Sorting Questions

orderby defaults to date, so we can always leave that out if we want to order by date. so the only thing we need to detect is if $_GET[‘sort’] is set and it’s equal to title. here we set the query args for all queries, and just add on the orderby if it’s title: $args … Read more

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