Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Friday, February 1, 2013

Give form to your RSS Feed with CSS


RSS feed icon
It is easy to give a better look to your rss feed in wordpress with with CSS (cascading style sheets). I'll show you a tutorial of 10 minutes , you can see the results by looking at the RSS feed of this site. Also you can do with XSL style but for now we are going to do with CSS that is easier. To start you need to add the tag xml-stylesheet to your RSS feed , for it opens the file wp-rss2.php and after the line:
<? Php echo '<? xml version = "1.0" encoding = "'. get_settings (' blog_charset ').'"? '.'> ';?>
added:
<? Php echo "\ n <? Xml-stylesheet type = \" text / css \ "href = \" ";?>
<? Php bloginfo ('stylesheet_directory');?>
<? Php echo "/ rss.css \"> ";?>
Then you have to create the file rss.css and place it in your theme directory within this file you define how to display RSS tags, an example of the contents of this file is as follows:
rss {
	 display : block;
	font-family: Verdana, arial;
	font-size: x-small;
}
channel link {
	display : block;
	margin: 5px 6px;
}
channel description {
	display : block;
	margin: 5px 6px;
}
item {
	background : # E8F8FD;
	 display : block;
	margin: 10px 30px;
	padding: 5px;
	border: 1px dotted # aaa;
}
title {
	font: bold large Arial, Helvetica, sans-serif;
	display : block;
	margin: 5px;
	padding: 2px;
	color: # 333;
	border-bottom: 1px solid silver;
}
item title {
	font-size: medium;
	color: # 666;
}
channel {item link
	display : block;
	margin: 0;
}
{comments
	display : block;
}
{docs
	display : block;
	margin: 20px;
	text-align: center;
	padding: 5px;
	color: # 7f7f7f;
	border: 1px solid silver;
}
channel item description {
	display : block;
	 background : # fff;
	border: 1px dotted # f5f5f5;
	margin: 3px 5px;
}
/ * To hide labels * /
language, lastBuildDate, ttl, guid, category, pubDate, generator {
	 display : none;
}
Apparently the Internet Explorer 7 Beta, I would not recommend using is not the style sheets of the RSS, however the RSS will show its own format of them, in Firefox it looks great.
Thank You!

What is 301 redirect? and how to make it


In going from one location on our website page Web access to it from other pages that link to get lost besides those who visit us from a search engine like Google will not find the page.
What we have to do is try to set up the page so that when the search engine robot know that the page has changed location permanently, for this we will use the 301 redirect, it should be noted that this state passes values PageRank for Google and the number of pages that link.
The 301 redirect is a state of the protocol standards HTTP , here are some ways to do it.

301 redirect with PHP

The redirect page we will replace it with a PHP file with the following code:
<? Php
header ("HTTP/1.1 301 Moved Permanently");
header ("location: http://www.neoideas.com.mx");
?>
It is important that this code is to the beginning of the php file (the first line).

301 redirect with ASP

The redirect page we will replace it with an ASP file with the following code:
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.url-de-la-nueva-direccion.com"
%>

301 redirect with ASP.NET

The redirect page we will replace it with an ASP file with the following code:

private void Page_Load (object sender, System.EventArgs e)
{
    Response.Status = "Moved Permanently";
    Response.AddHeader ("Location, http://www.url-nueva.com");
}

301 redirect with ColdFusion

The page that we will redirect ColdFusion replaced by a file with the following code:
<. Cfheader statuscode = "301" statusText = "Moved permanently">
<. Cfheader name = "Location" value = "http://www.url-de-la-nueva-direccion.com">

301 redirect with Apache

You create a. Htaccess (if not, if you edit the current one) in your root directory and add the following line:
Redirect 301 / http://www.url-de-la-nueva-direccion.com

Redireción 301 on an IIS server

We need to configure the server by entering the Internet Services Manager as follows:
  1. Select the "redirection to a URL"
  2. Enter the page that will redirect
  3. Check the URL introduced as "a permanent redirection for this resource"
  4. Click "Apply"

301 redirect from an HTML

This type of redirection is not possible, it is necessary for any of the above methods or access server configuration.
Note that in all these forms of redirection http://www.url-de-la-nueva-direccion.com need to change the new URL.