Browsing all articles in Code Snippet
Mar
9

How to make an Option Panel in your WP Theme in 5 minutes.

Author admin    Category Code Snippet, Plugin Modification     Tags

I was thinking to make a larger post about converting/simplifying a WordPress Theme, but I found so many details to dig in that I decided to split in more shorter posts for the best of the readers.

If you are a Theme Developer or you just wanted to improve a theme, usually you’ll need an Option Panel to customize the theme changing a few parameters.

read more

Dec
9

What are you looking for? Statpress has an answer

Author admin    Category Code Snippet, Tips     Tags

The interesting part for a plugin like Statpress is the chance to play with the data stored to see how the traffic is flowing on your site.

For one side, you can explore what the visitors want and where they go. For other part, it allows to detect potential problems (like a incorrect title o find a way to enhance the post content/title) and allow us to think a correct way to create posts. It is SEO on the run.

read more

Dec
6

WP to Twitter extension for qTranslate

Author admin    Category Code Snippet     Tags

In the previous post I commented the fact that WordPressready is using the qTranslate plugin to handle english and spanish languages. For the other hand the  WP to Twitter plugin sends messages in every post. Both plugins are very good indeed.

There is a small problem though. Wp to Twitter compose the message from the post title, which is ok except when the qTranslate plugin is installed. qTranslate uses a custom tag to separate languages inside the post title , for example:

This is an post title

WP to Twitter is doing the best it can to interpreting the title, supressing the customized tags to finally get:

This is an post titleEste es el título de una entrada

what is pretty ugly.

It could be nice if there is a simple way to solve it , don’t you think? Some kind of filter/action to handle this situation…

Ok, i’m still working on it. For the moment, I know where to put some filters, but remember this is a work in progress.

For the moment I did some code modification to WP to Twitter code so it will send a twitter message for every language set in the blog. This modification will work only when a post is created/updated (it won’t work when a page is created or when I post from xmlrpc). As I said, is a work in progress.

read more

Nov
25

Shortest way to add a favicon on your site

Author admin    Category Code Snippet     Tags

Drop this code in functions.php:

/*
name: Favicon Action
author: FZSM
url: http://www.wpgetready.com
description: shortest way to add favicon to your site
*/
function tabs_favicons() {
?>
<link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/images/favicon.ico">
<?php
}
add_action('wp_head', 'tabs_favicons');

You can create favicon.ico with  IcoFx for example and it has to be in the images folder in the current theme.

Nov
24

Como poner música MP3 dependiendo de una página

Author admin    Category Code Snippet     Tags

I have a client who asked me something very particular:

  • He wanted  a site with music in some pages. This is easy to solve. Also,
  • The customer wanted to hear some pages different songs in different pages
  • The customer wanted the music to start automatically when you open a page

There are several undercover details, and I included the following restrictions:

  1. The plugin should avoid unnecessary programming. This restriction eliminated some plugins, which require some add code to the pages or the page’s structure. At this moment I forgot who they were, maybe for good..
  2. The plugin should run in the sidebar. I can think of three reasons:
    • Is more appropriate to put it in the sidebar instead be added to each page.
    • Also, if you want to put a music in the whole site, where do you do it? In the sidebar for sure
    • The last reason is that it is a simple drag & drop the sidebar using widgets.
  3. Also, we had several pages with child pages. The idea is to find an easy way to play a specific song on a page and his child pages.

Language

Ads

Site5 Add
GoDaddy
Appsumo ad

Twitter