Ironpaper Current: Web design, online marketing, internet news, security and business online

Posts Tagged ‘code help’

Conditional Comments HTML – Internet Explorer Issues In Web Design

Monday, September 21st, 2009

Conditional comments work in Internet Explorer and on Windows only.  For this reason, you can create special instructions to be executed by Internet Explorer only ( on Windows ). Conditional comments are for Internet Explorer 5 and higher.

The basic structure of a conditional comment is the same as an HTML comment (<!– –>). When another browser sees such comments, they will simply ignore them.

This code snippet will target Internet Explorer 6:

<!–[if IE 6]>
Special instructions for IE 6 here
<![endif]–>

This code snippet will target Internet Explorer:

<!–[if IE 7]>
According to the conditional comment this is Internet Explorer 7<br />
<![endif]–>

This will target the browser: Internet Explorer and all versions above 5:

<!–[if IE]>
According to the conditional comment this is Internet Explorer<br />
<![endif]–>

CSS Margin – Web design help

Monday, September 21st, 2009

Web design tips

The CSS margin properties define the space around elements.

margin: top right bottom left;

The CSS property MARGIN clears the area surrounding an element. The background color of the MARGIN is transparent (no background color, at all).

Values of CSS MARGIN:
There are three possible values for the margin properties: auto, fixed, percentage.
1. Auto: The browser determines the margin.
2. Defines a fixed margin area. This area can be defined in px, pt, em, etc.
3. Defines a margin in percentage ( expressed as: % ) of the containing element

Defining margin for each side as a single statement:
margin-top: 0px;
margin-bottom: 0px;
margin-right: 0px;
margin-left: 0px;

Defining MARGIN for all sides in a single statement:
margin: top right bottom left;
margin: 1px 2px 3px 4px;

Define one value for all sides:
You can also define the margin properties using a single value, which will be applied to all sides.
margin: 1px;

margin css web design help

How to limit or exclude categories for Wordpress frontpage blog posts

Wednesday, September 9th, 2009

Wordpress Help and HintsWe have been asked a few times by bloggers how to limit or exclude categories from your Wordpress installation frontpage. By default Wordpress will display a stream of blog posts from all categories. Some bloggers may wish to not display certain categories in that stream of posts on their homepage. A few web designers asked us how to control or exclude specific categories that should not be displayed.

Our answer was to write the code for the theme, and not edit the core functionality since that would complicate WP updates.

In the index.php file of your theme, there is a Loop statement. Wordpress processes this Loop statement for each of the posts in your blog. The statement begins with this code snippet:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

The loop ends with this piece of code:

<?php endwhile; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
<?php endif; ?>

Here is one way to solve this problem. This will allow you to limit specific categories from your frontpage and publish the remaining categories automatically. We will try to expand upon this post soon and explain other options and this option in more detail. The numbers “1″, “3″, “5″, and “7″ are the categories to be excluded from the frontpage blog.

<?php while (have_posts()) : the_post(); ?>
<?php if (!in_category(‘1′) && !in_category(‘3′) && !in_category(‘5′) && !in_category(‘7′)) { ?>

POST CODE GOES HERE
<? } ?>
<?php endwhile; ?>