making a pseudo-static page

Create single.php in your themefolder and insert this code get_header(); ?> <div id=”primary” class=”content-area”> <div id=”content” class=”site-content” role=”main”> <?php /* The loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( ‘content’, get_post_format() ); ?> <?php twentythirteen_post_nav(); ?> <?php comments_template(); ?> <?php endwhile; ?> </div><!– #content –> </div><!– #primary –>

Page can not be updated and disappeared in “show all page”

You can try to repair your database. To do it, please read this answer in StackOverflow. If repairing database didn’t worked, you can try to update the post status manually. Connect to your database Find the page in the wp_posts table (you can find it through the post_title field) Update the record running a script … Read more

How to add feature image url in my template file and content as well?

Page’s don’t by default have a “Featured Image”. If you’ve found a plugin to do that, then to output the Featured Image use the following function: the_post_thumbnail() You can read more about it in the WordPress Codex here. There are various other functions that will return the image markup (get_the_post_thumbnail ()), or just the Featured … Read more

Grabbing the_content from “about us”

You can use get_page_by_title() or get_page_by_path() to retrieve page object that will have title and content (which you might need to further process a bit, depending on how complex it is). And if I remember right get_the_post_thumbnail() gives you featured image.

disable trashability for certain pages

Add this to your functions.php in your theme folder: function restrict_post_deletion($post_ID){ $user = get_current_user_id(); $restricted_users = array(21,25,54,2,19); $restricted_pages = array(2,21,52,64); if(in_array($user, $restricted_users) && in_array($post_ID, $restricted_pages)){ echo “You are not authorized to delete this page.”; exit; } } add_action(‘wp_trash_post’, ‘restrict_post_deletion’, 10, 1); add_action(‘wp_delete_post’, ‘restrict_post_deletion’, 10, 1); Taken from here and updated to the latest WP version.

Directory location of new page

WordPress does not create a new file in the filesystem when you create a page from the backend. The data you enter into the backend is saved to the MySQL database where it is retrieved by various and sundry queries and displayed by code in one or more templates. There is no “directory location” for … Read more

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