Sometimes it happens that working with WordPress, we need to get children off current page. There is a fairly simple decision to do this. We can use the WordPress function get_pages (). Here is the code example of how this can be done.

<? $pages = get_pages('child_of='.$post->ID.'&sort_column=post_title');
		?>
		<ul><?
		foreach($pages as $page)
		{ ?>
			<li class="page_item"><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></li>
		<?php
		}
?></ul>

In this example we get page title and page link.

Sometimes it is necessary to have page content in WordPress. This can be done quite easily. Use this code

 
 $pageId = 68;

			global $wpdb;
			$sql_query = 'SELECT DISTINCT * FROM ' . $wpdb->posts .
			' WHERE ' . $wpdb->posts . '.ID=' . $pageId;
			$posts = $wpdb->get_results($sql_query);
			if(!empty($posts))
			{
				foreach($posts as $post)
				{
					print_r(nl2br($post->post_content)); 
				}
			}

There $pageId, use your page ID, which content you want to see.

Sometimes, creating a two levels menu and adding to site content embed video, submenu disappear under embed videos. A possible solution is add wmode=”opaque”. But what happens when we’re adding embed video dynamically, or we need to change dynamically all embed wmode to opaque. In this case, the possible use of jQuery library, and this script:

$(document).ready(function() {
 var embedTag;
 $(".youtube embed").each(function(i) {
 embedTag = $(this).attr("outerHTML");
 if ((embedTag != null) && (embedTag.length > 0)) {
 embedTag = embedTag.replace(/embed /gi, "embed wmode=\"opaque\" ");
 $(this).attr("outerHTML", embedTag);
 }
 });

Use this for firefox:

$('.youtube embed').attr('wmode','opaque');

Now give for submenu position:relative and indicate z-index (for example z-index:999) to show the submenu above this EMBED video.

There is a posibility to add transparency background with RGBa. You can use this for anything that can take the CSS color property. For example background: rgba(255, 255, 255, 0.5);. 0.5 is alpha. This property works in Firefox, Safari, Chrome, Opera, but nor in IE.

IE uses the syntax filter:alpha(opacity=50). The lower value of this makes the element more transparent.

For example:

.myclass
{
background:#000000;
filter:alpha(opacity=50);
}

There will be black background with 50% transparency.

Creating, editing and deleting the user account is an important thing in any CMS. We can easily manage user in wordpress sites too. There are a lot of plugins which helps us create User profile and manage there profile.

But in wordpress deleting User from wordpress is not easy. Here in this article we will show how can we easily delete the user account without administrator permission.

Using following wordpress plugin we can achieve this functionality.

User Self Delete

This plugin will allow your users to delete their own account without any need for interaction on the administrator’s behalf.

When user want to delete their account, they are taken to page where they must enter the word “yes” . Once they type “yes” and press the delete account button, they are redirected to the login page and they no longer exist as a user in site.

If you are making the wordpress plugin, many times we need to create new tables. You will see how easily we can create the wordpress plugin with new table in database.
Using following code:

global $my_db_version;
$my_db_version = "1.0";
function my_install () {
global $wpdb;
global $my_db_version;
$table_name = $wpdb->prefix . "liveshoutbox";
if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
$sql = "CREATE TABLE " . $table_name . " (
id mediumint(9) NOT NULL AUTO_INCREMENT,
name tinytext NOT NULL,
UNIQUE KEY id (id)
);";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
$rows_affected = $wpdb->insert( $table_name, array('name' => $welcome_name) );
add_option("my_db_version", $my_db_version);
}
}

Now that we have the initialization function defined, we want to make sure that WordPress calls this function when the plugin is activated by a WordPress administrator. To do that, we will use the activate_ action hook. If your plugin file is wp-content/plugins/plugindir/pluginfile.php, you’ll add the following line to the main body of your plugin:

register_activation_hook(__FILE__,'my_install');

Now you can easy add sliding text in your site or blog.

For this plugin is used jquery 1.4.2 library and jquery.marquee library.

Usage:
1. Download the plugin.
2. Extract It.
3. Upload to the /wp-content/plugins/ directory.
4. Activate the plugin through the ‘Plugins’ menu in WordPress.
5. Options can be edited from ‘Settings/Marquee’.

Insert in html:
1. Php inserts can be used as <?php echo show_marquee(); ?>.
2. You can also use trigger text such as <!– marquee –>.
3. Triggers can be inserted through HTML view of the wordpress editor.
4. Currently this version works with PHP 5.0 or above.

Download this plugin you can here: marquee.

Seo WordPress Plugins

1. All in One SEO Pack – By far the gold standard of SEO plugins, “All in One” provides a multitude of easy to understand options to get your blog up to par SEO wise. 99% of WordPress users will agree when I say this is an absolute must have when it comes to plugins. With over 2 million downloads and growing, you can’t go wrong.

2. SEO Title Tag – Although the plugin above can control title tags on your WordPress blog, this plugin is an outstanding solution to optimize and customize every title tag on your blog.

3. HeadSpace2 SEO – This handy dandy SEO plugin will allow you to customize meta-data for nearly every aspect of your blog including posts, pages, categories, home page, search pages, author pages, and even 404 pages. This is a super alternative to All in One SEO Pack, just not quite as popular.

Continue reading

I’ve moved my site in the last few days to a new dedicated server. I’ve decided to switch to Lighttpd. Now I can say that I’m fairly satisfied with the move.

But after I transfered the domain to the new server I’ve found out that none of my inner pages are accessible. The reason, as it turned up pretty quickly, is that the WordPress depends on Apache’s mod_rewrite to create the clean URLs (the so called permalinks).

Continue reading