on page creation few inline style properties gets removed

Thought the language is a bit confusing, if you check the Codex and pay attention to the difference between the Admin and the Super Admin you should be able to see what is happening. In the case of single site WordPress installation, Administrators are, in effect, Super Admins. As such, they are the only ones … Read more

Use page template for custom $_GET content

You can use the template_include filter to load a template file from your theme: add_filter( ‘template_include’, ‘my_page_template’, 99 ); function my_page_template( $template ) { if ( isset( $_GET[‘info’] ) && $_GET[‘info’] == ‘some_value’ ) { $new_template = locate_template( array(‘my-template.php’ ) ); if ( ” != $new_template ) { return $new_template ; } } return $template; … Read more

is_single(); Question

You should have a look at using conditional tags in wordpress. is_single() is the conditional tag for a single page, ie single.php. For homepage, is_home() or is_front_page() should be use, depending on whether a front page is set in settings or not.

Set a variable to using in redirected page

I think wp_login is executing before functions.php is actually opened, thus not setting the global variable. One possible solution to this is instead append to the URL: function open_menu($user_login) { wp_redirect(home_url().’?menu_open=true’); exit; } add_action(‘wp_login’, ‘open_menu’); Then you could get that value via if(isset($_GET[‘menu_open’]) && $_GET[‘menu_open’])

Page templates in subdirectories and auto generator

Instead of having a page template for all of them, have a single page template and use get_template_part to pull in the parts unique to each page. So instead of: update_post_meta($new_page_id, ‘_wp_page_template’, $page_filename); You’d have: update_post_meta( $new_page_id, ‘_wp_page_template’, ‘newpagetemplate.php’ ); update_post_meta( $new_page_id, ‘sagive_page_type’, $page ); Then inside your new page template: $type = get_post_meta( get_the_id(), … Read more

Display pages in alphabetical order

Filter pre_get_posts is used for modifying the query from theme or plugin. This hook is called after the query variable object is created, but before the actual query is run. Codex documentation of pre_get_posts Although this filter is very handy and useful, we need to be very careful using it. We should very careful about … Read more