homepagemenu

How to Show Home Link or Button in WordPress Menu

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

When WordPress 3. 0 was launched, a lot of people would not find out about how you can put in a homepage web page link within the WordPress 3. 0 Food list. The straightforward remedy ended up being to provide home-page web page link to be a Tailor made Connection to your menu. Properly in this article, all of us will show you how one can show homepage web page link within the internet pages golf widget within WordPress 3. 0 menu method. It is something all concept programmers must have inside their WordPress 3. 0 appropriate themes or templates.

First open your theme’s functions.php file and add the following PHP code:

function home_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'home_page_menu_args' );

After having pasted the code, It should create “Home” just as one solution underneath the “Pages” widget around the Menus operations site so the end user can just examine that away just as one item to add to their particular custom made menus.

Add home link in WordPress

Add home link in WordPress

Isn’t it very easy?

Read More

Simple Lightweight Open Source PHP editor of txt files

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Try this:


<?php

// configuration
$url = 'http://www.leonli.co.uk/path-to-editor.php'; //change this to your php file path
$file = '/path/to/file'; //change this to your target file path

// check if form has been submitted
if (isset($_POST['text']))
{
    // save the text contents
    file_put_contents($file, $_POST['text']);

    // redirect to form again
    header(sprintf('Location: %s', $url));
    printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
    exit();
}

// read the textfile
$text = file_get_contents($file);

?>
<!-- HTML form -->
<form action="" method="post">
<textarea style="width:700;height:200;" name="text"><?php echo htmlspecialchars($text) ?></textarea>

<input type="submit" />
<input type="reset" />
</form>

Read More

Debian 7.0 Wheezy PHP 5.3 Install (Downgrade from PHP5.4)

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Debian Wheezy comes with PHP 5.4. If this is too new for your application and it doesn’t work properly, here is a short description on downgrading to PHP 5.3.

Add the following to /etc/apt/sources.lst

deb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free

Create

/etc/apt/preferences.d/preferences

And add the packages you need downgraded such as in my case

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

#Package: libapache2-mod-php5

#Pin: release a=oldstable
#Pin-Priority: 700

Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

Then run the commands

aptitude update
aptitude reinstall <necessary packages>

 

 

  • First, add these two lines to /etc/apt/sources.list. In short, it adds Debian Squeeze repositories as an additional source of packages:

deb http://ftp.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free

 

  • Then, add these to pin your old PHP 5.3 packages, to /etc/apt/preferences.d/preferences. If you don’t have this file, create an empty one.

Package: php5*
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: libapache2-mod-php5
Pin: release a=oldstable
Pin-Priority: 700

Package: php-pear
Pin: release a=oldstable
Pin-Priority: 700

Package: php-apc
Pin: release a=oldstable
Pin-Priority: 700

Package: *
Pin: release a=stable
Pin-Priority: 600

 

  •  This will list your PHP packages

PHP=$(dpkg -l|grep php|grep 5.4.4|awk '{print $2}')

 

  • Finally, reinstall:

# apt-get update

# apt-get install –reinstall $PHP
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libicu44 libjpeg62 libmagickcore3 libmagickwand3 libmysqlclient16 libt1-5 php5-suhosin
Suggested packages:
libmagickcore3-extra php5-dev
The following NEW packages will be installed:
libicu44 libjpeg62 libmagickcore3 libmagickwand3 libmysqlclient16 libt1-5 php5-suhosin
The following packages will be DOWNGRADED:
libapache2-mod-php5 php-apc php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-imagick php5-imap php5-intl php5-mcrypt php5-mysql
0 upgraded, 7 newly installed, 4 reinstalled, 14 downgraded, 0 to remove and 0 not upgraded.
Need to get 30.5 MB of archives.
After this operation, 30.9 MB of additional disk space will be used.
Do you want to continue [Y/n]?

Read More