J Post Slider wordpress plugin – jQuery post animation show

Boban Karišik developed nice jQuery slide show images script. This jQuery slide show, rotate images, and showing out transparent div with image description.

I used this jQuery Script, to develop WordPress plugin which can be customized in admin area. This plugin will rotate latest posts from blog, presented with selected image, post headline, and optional post excerpt. One post can have one J Post Slider, image for this animation.

You can set up:

  1. How many latest post to rotate
  2. Post offset, if you don’t want to show latest post in J Post Slider Box
  3. Images Width and Height for animation box. NOTE: every image you pick for J Post Slider plugin need to have same sizes, to make this animation look smootly
  4. Animation speed
  5. To show or not post excerpt
  6. Headline and excerpt can show up from top, left, bottom or right. Plugin can show up text area top and bottom, or left and right reciprocally or it can show area randomly
  7. Text area opacity
  8. Select categories from which this plugin can rotate post.

J Post Slider WordPress Plugin

J Post Slider WordPress Plugin at the admin post page


Continue reading

Create your own rewrite rules in WordPress

When you write your own WordPress plugin you might need to add new rewrite rules to WordPress. Some people add Rewrite rules direct into htaccess file, but when you open it you can see that WP don’t store rules into this file. All WordPress rewrite rules are stored into the database.

Default WordPress htaccess file


RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

For manipulation with rewrite you can use WP_Rewrite class. It’s functions all listed at the WP Codes, but i will show you how to use most important ones.

rewrite_rules() function

function getRewriteRules() {
    global $wp_rewrite; // Global WP_Rewrite class object
    return=$wp_rewrite->rewrite_rules(); 
}

This function “getRewriteRules”, will return array with listed rewrite rules. Array will be something like …

Array
(
    // ....
    [author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$1&feed=$2
    [author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] => index.php?author_name=$1&feed=$2
    [author/([^/]+)/page/?([0-9]{1,})/?$] => index.php?author_name=$1&paged=$2
    [author/([^/]+)/?$] => index.php?author_name=$1
    // ...
)

Continue reading