Mostly when we change permalinks in wordpress there is no image display and in some places we give link wp-content/ and some time ..wp-content/. This cause error when we make site live. For that we use this refrence link.
<base href=”<?php echo bloginfo(‘url’); ?>/”>
And basic another css and js link.
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_directory’); ?>/css/styles.css” />
<link rel=”shortcut icon” href=”<?php bloginfo(‘stylesheet_directory’); ?>/favicon.ico” />
<script src=”<?php bloginfo(‘stylesheet_directory’); ?>/js/jquery-latest.js” type=”text/javascript”></script>
For Image link.
<img src=”<?php bloginfo(‘template_directory’); ?>/images/logo.jpg” alt=”logo” />
For home page link.
<?php echo home_url();?> and link for some other page we use this <?php echo home_url(‘/contact-us’); ?>
For permalink.
<a href=”<?php the_permalink(); ?>”>You</a>
For slider with specific category.
<ul id=”slides1″>
<?php $my_query = new WP_Query(‘category_name=topstory’);
while ($my_query->have_posts()) : $my_query->the_post();
$do_not_duplicate = $post->ID; ?>
<li><?php the_content(); ?></li><?php endwhile; ?>
</ul>
We create specific menu for Navigation.
<?php wp_nav_menu( array( ‘container_class’ => ‘top-navigation-mid’, ‘menu’ => ‘main’ ) ); ?>
Widget call on header,footer and template page.
Where study is widget name which we can create in function.php.
<?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘Study ‘) ) { ?>
<?php } ?>
I use this code for two different menu according two different languages where ’19’ is page_id of English page.No plugin and another function use for two different languages so this code is use so many time in different template pages.
<?php if (is_page(‘English’)|| $post->post_parent == ’19’ )
{wp_nav_menu( array( ‘container_class’ => ‘menu’, ‘menu’ => ‘english’ ) ); }
else { wp_nav_menu( array( ‘container_class’ => ‘menu’, ‘menu’ => ‘french’ ) );
}
?>
For front page and specific page.
<?php if(is_front_page() || is_page(19) ) { ?>
For single post in template pages.
<?php $post_id = 29;
$queried_post = get_post($post_id);
echo the_author_meta(‘display_name’,$queried_post->post_author);?> <h2 class=”mystudy”><?php echo $queried_post->post_title; ?></h2>
<?php echo $queried_post->post_content; ?>
Now,we mostly use radius in border which also in hover, we can avoid little mistake using below css.
li:first-child a
li:first-child a:hover
<!–form validation–>
<form name=”form2″ id=”form2″ method=”post” action=”career.php” onsubmit=”return validate1(this)”>
Css for even odd classes.
<script src=”../jquery.min.js”></script>
<script type=”text/javascript”>
$(document).ready(function() {
$ (‘div.technical-expertise-list li:even’).addClass(‘even’);
$ (‘div.technical-expertise-list li:odd’).addClass(‘odd’);
});
</script>
<style>
.even{
background-image: url(“<?php bloginfo(‘template_directory’); ?>/images/bullet-5.png”);
}
.even:hover{
background-image: url(“<?php bloginfo(‘template_directory’); ?>/images/bullet-4.png”);
}
.odd{
background-image: url(“<?php bloginfo(‘template_directory’); ?>/images/bullet-4.png”);
}
.odd:hover{
background-image: url(“<?php bloginfo(‘template_directory’); ?>/images/bullet-5.png”);
}
</style>