Settembre 2011
17 post
2 massimo
Excerpt - how to modify
insert this in function.php (taken from twentyeleven default wordpress theme)
/**
* Sets the post excerpt length to 40 words.
*
* To override this length in a child theme, remove the filter and add your own
* function tied to the excerpt_length filter hook.
*/
function twentyeleven_excerpt_length( $length ) {
return 40;
}
add_filter( ‘excerpt_length’,...
3 massimo
if ( is_page
<?php /* INIZIO —- CONTROLLO PER INSERIRE UN LOGO DIVERSO A SECONDA DELLA PAGINA */ ?>
<?php
if ( is_page( ‘le-nuove-residenze’ ) || ‘8’ == $post->post_parent ) {
$bannerimg = ‘http://marchettinanucostruzioni.com/wp-content/uploads/2011/09/nuoveresidenze.png’;
} elseif ( is_page( ‘i-luoghi’ ) || ‘169’ ==...
Flesler scrollTo →
1 tag
pupunzi →
1 tag
jQuery Themes →
script.aculo.us/ →
8Bit Color Cycling →
2 massimo
splash overlay - FredPerry →
1 tag
King of jQuery: Flesler →
2 massimo
simple javascript redirect
<script type=”text/javascript”>
window.location = “http://bb-styleblog.blogspot.com/”
</script>
2 massimo
PHP mail - testing
<?php
$email = “wondercore@gmail.com”; # email address of recipient
$subject = “This is a test email”; # subject of email
$body = “This is where the text goes…”;
$mail_hrd = “From: webmaster@MyWebSite.com <webmaster@MyWebSite.com;”;
mail($email,$subject,$body,$mail_hdr)
?>
2 massimo
Contact Form 7: aggiungere form inline
<?php echo do_shortcode(‘[contact-form-7 id=’1680’ title=’prenota online’]’); ?>
2 massimo
phpinfo.php
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
1 tag
13 Mysql Queries for Wordpress
An easy way to run any of the queries below is to use phpMyAdmin. phpMyAdmin is one of the most common database look-up and editing tool. Almost all the web hosting services’ control panels provide this. There is alsoWordPress SQL Executioner - a WordPress plugin that allow you to execute your SQL query.
To use phpMyAdmin follow the steps below:
Login to phpMyAdmin panel and select your...
2 massimo
Contact Form 7: Delete text when the input tex is...
If you have a form text field with default value / text like “Enter your Name: ”. As soon a visitor clicks on it to enter his Name the text should disappear. Is there a way to create this in wordpress if we use contactform7 plugin? Fortunately there is a way. Here is the steps:
1. add the below javascript to header.php
<script type=”text/javascript”> function clearText(field)...
Prendere custom field →
<!— DESCRIZIONE —>
<? if (get_post_meta($post->ID, ‘descrizione’, true)) { ?>
<?php $descrizione = get_post_meta($post->ID, ‘descrizione’, true);
if(trim($descrizione)== “”) $descrizione = get_post_meta($post->ID, ‘descrizione’, true);
?>
<?php echo...
1 tag
Insert 2 sidebar/area widget in template page
1. inserire in function.php