Add this constant to your wp-config.php file to disable plugin and theme updates/installation:
define('DISALLOW_FILE_MODS',true);
define('DISALLOW_FILE_MODS',true);
function get_id_by_post_name($post_name)
{
global $wpdb;
$id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$post_name."' AND post_status='publish'");
return $id;
}
/wp-content/themes/default” where “default” is your theme name.cover_page.php” and add the following code to it:
<?php /* Template Name: Cover Page */ ?> <?php get_header(); ?> Here's my cover page! <?php get_footer(); ?><?php if (is_page_template('cover_page.php') )
{ ?> <p>Apples</p> <?php }
else { ?> <p>Oranges</p> <?php } ?>
Paste the following code snippet in your functions.php file.
Once done, a rel="lightbox" attribute will be automatically
added to all images embedded in a post.
function my_addlightboxrel($content) {
global $post;
$pattern ="/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
$replacement = '<a$1href=$2$3.$4$5 rel="lightbox"
title="'.$post->post_title.'"$6>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
add_filter('the_content', 'my_addlightboxrel');
function custom_toolbar_link($wp_admin_bar) {
$args = array(
'id' => Help,
'title' => 'Help',
'href' => 'http://h20bikash.blogspot.com/',
'meta' => array(
'class' =>Help,
'title' => 'Help'
)
);
$wp_admin_bar->add_node($args);
}
add_action('admin_bar_menu', 'custom_toolbar_link', 999);
function modify_post_mime_types( $post_mime_types ) {
// select the mime type, here: 'application/pdf'
// then we define an array with the label values
$post_mime_types['application/pdf'] = array( __( 'PDFs' ), __( 'Manage PDFs' ), _n_noop( 'PDF (%s)', 'PDFs (%s)' ) );
// then we return the $post_mime_types variable
return $post_mime_types;
}
// Add Filter Hook
add_filter( 'post_mime_types', 'modify_post_mime_types' );
define('EMPTY_TRASH_DAYS', 1);