Adding White Space in XSLT Stylesheet
XSLT can be quirky at times. Try inserting a space between your plain text and a element and its highly likely that you’ll just get a big blob of text. Not particularly helpful. We need a way to preserve that white space in our stylesheet. There are two ways we could approach this. The <xsl:text> element preserves the white space between the tags so we could use this to add our space. Also we this element will retain any line brakes we may add as well. We also can accomplish similar means by using the xsl:space attribute wrapped around the text we are looking to preserve.Reading & Writing to a Cookie Inside a HttpHandler
When you are working within an HttpHandler, sometimes you need to access or write out state information. Since this is wrapped up in a class and not inheriting from the Page class, we need to approach this in a slightly different manner. The ProcessRequest method within IHttpHandler has a Response object drawn from HttpContext. The functionality works the same, we just need to adjust how we reference the cookie as follows:
Writing out a Cookie Reading from the CookieDisplay Alternate Sidebar Based on Page in WordPress
I don’t know about you, but I get tired looking at that same right sidebar on every page of my WordPress sites. Not all pages are created equal, and some need to serve up different content based on where we are in the site. For my particular case, I wanted to display custom content to the last page in a checkout process. To do this we have to first determine which page we are on by looking at the $_SERVER['REQUEST_URL']. If we were on http://aspnetprogrammer.net/hello_world, it would return the value hello_world. Next, we set the queryValue of the page we are looking for then trigger our comparison. The strstr function in php compares two strings, telling us if the second is contained within the first. If it is, we display the checkout.php sidebar. Otherwise, we let the default sidebar load as normal.
Add Home Page Link to Menubar in WordPress Blog
It is about the most basic thing in the world to start a menu navigation bar with a link to your home page, but for some reason many nice WordPress templates seem to have overlooked this essential element. It will list out your categories fine, but no go on getting you back to the beginning. Let’s fix that oversight. In your header file under Appearance > Editor (this file may be called something different depending on the template you are using), we’re going to look for a line of code that looks like this:
That is where these category options are getting inserted. Now to append a link to the home page to the beginning of these links simply precede the above line with the following code:
