Is it possible to manipulate the list of page templates?

The workhorse is WP_Theme::get_page_templates() (wrapped by the helper function get_page_templates()). If you check out the source, you’ll see: /** * Filter list of page templates for a theme. * * @since 3.9.0 * @since 4.4.0 Converted to allow complete control over the `$page_templates` array. * * @param array $page_templates Array of page templates. Keys are … Read more

How can I have two different urls for the same page that load two different templates?

You could accomplish this with a rewrite endpoint and a template filter. First, register a new rewrite endpoint for the page post type: function wpd_app_view_rewrite_endpoint() { add_rewrite_endpoint( ‘app-view’, EP_PAGES ); } add_action( ‘init’, ‘wpd_app_view_rewrite_endpoint’ ); Don’t forget to flush rewrite rules after adding this (or just visit the Permalinks > Settings page to do this … Read more

get page templates

Checking for get_page_templates() in the core, I found a workaround that doesn’t break the theme like: Fatal error: Call to undefined function get_page_templates() I’m using this just after <body> and works ok: $templates = wp_get_theme()->get_page_templates(); foreach ( $templates as $template_name => $template_filename ) { echo “$template_name ($template_filename)<br />”; }

How to get Images included in Post

You can use get_posts() (Codex ref for getting Post attachments). <?php $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attached_images = get_posts( $args ); ?>

How to override admin-bar style

You can override admin-bar with this function, don’t need to mess with admin-bar.css. Steps: Write your css Put inside the function (given below) Add this inside functions.php // customize admin bar css function override_admin_bar_css() { if ( is_admin_bar_showing() ) { ?> <style type=”text/css”> /* add your style here */ </style> <?php } } // on … Read more

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