is_page_template not working

is_page_template() will only tell you if the page is using a custom page template. Meaning a template that was created by adding the Template Name: comment to the file and selecting it from the Template dropdown, as described here. The function works by checking the post meta for which template was selected. If you have … Read more

How to edit contents of dynamic_sidebar()?

The contents of dynamic_sidebar are pulled from the widgets associated with this “Sidebar” aka “Widget Area” in wp-admin, as @s_ha_dum answered. There is no template file for the sidebar itself. Visit /wp-admin/widgets.php under Appearance -> Widgets and find the widget area titled homepage-infobox. You be able to add/remove widgets and possibly make changes to the … Read more

Set page template for all pages?

EDIT As noted in the comments on your question, the best approach would just be to edit your page.php file. If you want ALL of your pages to have the same page template, and not have to do anything extra to set it that way, it’s quite obvious why this is a good idea. 🙂 … Read more

Page Template as Custom Post Type Archive

Since WordPress version 4.4 the hook ‘theme_page_templates’ allows to set arbitrary page templates. It means that it’s possible to show arbitrary values in the “Page Template” menu of the page edit screen, and when selected, the value will be stored in the page template meta for the page. This means that you can “automagically” create … Read more

What are the differences between custom post type and custom page templates?

Taxonomies are categorizations of data. Tags are a taxonomy. Categories are another taxonomy. If you are building a movie website and want to show which actors starred in which movie, “Movies” would be a custom taxonomy. Custom Post Types are really just custom data items. They’re stored just like posts and pages, but aren’t considered … Read more

Add custom template page programmatically

The article linked is on the right track, but i’ll make it more simple for you.. 😉 add_filter( ‘page_template’, ‘catch_plugin_template’ ); function catch_plugin_template( $template ) { if( ‘tp-file.php’ == basename( $template ) ) $template = WP_PLUGIN_DIR . ‘/yourpluginname/tp-file.php’; return $template; } The filter basically looks to see if your special page template is set for … Read more

Passing parameters to a custom page template using clean urls

add_rewrite_rule() allows you to turn the pretty url into variables. numbers: (\d*) section: /rid/ or /pageid/ slug: ([a-zA-Z0-9-]+ Here is a class to register the rewrite and handle the request if a match has been found. <?php if ( ! class_exists( ‘CPTURLRewrite’ ) ): class CPTURLRewrite { const ENDPOINT_QUERY_NAME = ‘pageid’; const ENDPOINT_QUERY_PARAM = ‘__pageid’; … Read more

How to add a .php file to WordPress

What you can do is this: Put up.php in your active theme’s folder, and put this line at the top of your up.php file: <?php /* Template Name: Up */ ?> Create a page called Up in your WordPress Dashboard, then on the right side of the edit page screen, set the Template to ‘Up’. … Read more

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