Scroll box

**Dreamgrow Scroll Triggered Box**
„https://wordpress.org/plugins/dreamgrow-scroll-triggered-box/“:https://wordpress.org/plugins/dreamgrow-scroll-triggered-box/

The box is designed to get the attention of the visitors who have engaged with your site. The box triggers on certain event you specify, such as percentage of scroll, reaching an end of the post or comments. This verifies that visitors are engaged with the content and presenting them with a call-to-action.

What do you get with this plugin?

– Getting more subscribers to your newsletter
– Making people share your posts
– Driving visitors deeper with related posts
– Filling out a contact form
– Displaying best offers

– Set the amount of days for the box to stay hidden if visitor closes it
– Design templates to save you time with the appearance of the box
– Fully customization if you want to use your own design (HTML and CSS)
– Control the position of the box (pages, posts, frontpage, left, right)
– When to trigger the box (% of scroll, specific element)

*Alternativa*

**Scroll Triggered Boxes**
„https://wordpress.org/plugins/scroll-triggered-boxes/“:https://wordpress.org/plugins/scroll-triggered-boxes/

– subscribing to your newsletter
– sharing a post
– submitting a contact form
– or something entirely different, you decide!

Really anything is possible, from social media sharing options to sign-up or contact forms. The plugin is designed to work with any other plugin that uses shortcodes.

Přidání nového příspěvku programátorsky

/—code php

/*
A function used to programmatically create a post in WordPress.
@returns -1 if the post was never created, -2 if a post with the same title exists, or the ID of the post if successful.
*/

function programmatically_create_post($user_id) {
// Initialize the page ID to -1. This indicates no action has been taken.
$post_id = -1;

// Setup the title of the post
$title = ‚My New Post‘

// If the page doesn’t already exist, then create it
if( null == get_page_by_title($title)) {
// Set the post ID so that we know the post was created successfully
$new_post = array(
‚post_title‘ => $title,
‚post_name‘ => my-new-post,
‚post_content‘ => ‚Lorem ipsum dolor sit amet…‘,
‚post_status‘ => ‚publish‘,
‚post_date‘ => date(‚j.n.Y H:i:s‘),
‚post_author‘ => $user_id,
‚post_type‘ => ‚post‘,
‚post_category‘ => array(0),
‚comment_status‘ => ‚closed‘,
‚ping_status‘ => ‚closed‘,
);
$post_id = wp_insert_post($new_post);
// Otherwise, we’ll stop
} else {
// Arbitrarily use -2 to indicate that the page with the title already exists
$post_id = -2;
} // end if
} // end programmatically_create_post
\—

„Programmatically Create a Post in WordPress »“:http://tommcfarlin.com/programmatically-create-a-post-in-wordpress/
„How to Create a Post in WordPress Programmatically »“:How to Create a Post in WordPress Programmatically

To lze využít např. pro automatické vytvoření příspěvku z uživatelského profilu při jeho ukládání přes „user_register hook“:http://codex.wordpress.org/Plugin_API/Action_Reference/user_register:

/—code php
add_action(‚user_register‘,’programmatically_create_post‘);
\—

Jak přidat tlačítko do HTML editoru

/—code php
// Add buttons to html editor
add_action(‚admin_print_footer_scripts‘,’eg_quicktags‘);
function eg_quicktags() {
?>

Manipulace s údaji v Contact Form 7 před a po odeslání

„WordPress Contact Form 7 Hook Unofficial Developer Documentation and Examples »“:http://xaviesteve.com/3298/wordpress-contact-form-7-hook-unofficial-developer-documentation-and-examples/

„Changing Form Data Before it is Saved »“:http://cfdbplugin.com/?page_id=747

„Contact Form 7 – form submit change field value »“:https://wordpress.org/support/topic/form-submit-change-field-value

„How to create a mail counter for Contact Form 7 »“:http://sevenspark.com/tutorials/how-to-create-a-counter-for-contact-form-7

„Extending the Contact Form 7 Plugin »“:http://kovshenin.com/2010/wordpress-extending-the-contact-form-7-plugin/

[private]

/—code php

### příklad použitý na http://u904.cz/mimoradna-nabidka-lifebook-a512/
### pocitadlo objednavek odeslanych z CF7

// Define the key to store in the database
define(‚CF7_COUNTER‘, ‚cf7-counter‘);
define(‚CF7_LASTORD‘, ‚cf7-lastord‘);
define(‚POCNAB‘, ‚200‘); // startovni pocet kusu

### Create the shortcode which will read the value from db option
function cf7db_reader(){
$val = get_option(CF7_COUNTER, POCNAB); // kdyz neexistuje option v db, vrati startovni pocet
return $val;
}
add_shortcode(‚CF7_show‘, ‚cf7db_reader‘);

### Action performed BEFORE the mail is sent by CF7
function wpcf7_change_mail($form) {
$formid = $form->id; // gets current form id
if ($formid == ‚384‘) {
$wpcf7 = WPCF7_ContactForm::get_current(); // get current FORM instance
$wpcf7data = WPCF7_Submission::get_instance(); // // get current SUBMISSION instance
if ($wpcf7data) {
$formData = $wpcf7data->get_posted_data();
}
// Reading a posted value in the form with PHP
$poc = $formData[‚pocet‘]; // nacte hodnotu z prave odeslaneho formulare
$val = get_option(CF7_COUNTER, POCNAB); // nacte aktualni hodnotu skladu, kdyz neexistuje option v db, vytvori a naplni ji startovnim poctem objednavku.

// nahrada dat v mailu
$mail = $wpcf7->prop(‚mail‘);

if($poc > $val): // objednano vic kusu, nez je na sklade, nahradim REPLACER textem
$mail[‚pocet‘] = $val; // snizim objednany pocet
// doplnim upozorneni do mailu
// Find/replace the „special“ tag as defined in your CF7 email body
$mail[‚body‘] = str_replace(‚REPLACER‘, „Jelikož jste objednali větší počet („.$poc.“ ks), než bylo aktuálně k dispozici skladem („.$val.“ ks), bude objednaný počet snížen na dostupné množství.\n“, $mail[‚body‘]);
else: // odstrani REPLACER string
$mail[‚body‘] = str_replace(‚REPLACER‘, „“, $mail[‚body‘]);
endif;

// Save the email body
$wpcf7->set_properties(array(„mail“ => $mail));

// return current cf7 instance
return $wpcf7;
}
}
add_action(‚wpcf7_before_send_mail‘, ‚wpcf7_change_mail‘);

### Action performed WHEN the mail is sent by CF7
function cf7_decrement_order_counter($form){
$formid = $form->id; // gets current form id
if ($formid == ‚384‘) {
// $wpcf7 = WPCF7_ContactForm::get_current(); // get current FORM instance
$wpcf7data = WPCF7_Submission::get_instance(); // // get current SUBMISSION instance
if ($wpcf7data) {
$formData = $wpcf7data->get_posted_data();
}
$poc = $formData[‚pocet‘]; // nacte hodnotu z prave odeslaneho formulare
$val = get_option(CF7_COUNTER, POCNAB) – $poc; // kdyz neexistuje option v db, vytvori a naplni ji startovnim poctem snizenym o odeslanou objednavku.
update_option(CF7_COUNTER, $val); // Update the settings with the new count
update_option(CF7_LASTORD, $poc); // Update the settings with the new count
}
}
add_action(‚wpcf7_mail_sent‘, ‚cf7_decrement_order_counter‘);

### zmena poctu objednanych kusu v databazi odeslanych formularu (Contact Form DB)
function change_cfdb_value($formData){
$formName = ‚A514‘;
if ($formData && $formName == $formData->title) {
$poc = $formData->posted_data[‚pocet‘];
$val = get_option(CF7_COUNTER, POCNAB);
if($poc > $val): // objednano vic kusu, nez je na sklade
$formData->posted_data[‚dodavka‘] = $val;
else:
$formData->posted_data[‚dodavka‘] = $poc;
endif;
}
return $formData;
}
add_filter(‚cfdb_form_data‘, ‚change_cfdb_value‘);

### Change content of Ordering Page
function formRemover($content) {
if(!is_feed() && !is_admin() && is_page(381)) {
$val = get_option(CF7_COUNTER);
if($val == 0):
$content = str_replace(‚

Tak neváhejte!

‚, ‚

Prodej byl ukončen.

‚, $content);
else:
$content = str_replace(‚

‚, ‚

Objednávkový formulář

Chyba: Kontaktní formulář nebyl nalezen.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚formRemover‘);

### Change content of Thank You Page
function orderAlert($content) {
if(!is_feed() && !is_admin() && is_page(385)) {
$val = get_option(CF7_COUNTER, POCNAB);
$poc = get_option(CF7_LASTORD, 0);
$roz = $poc-$val;
if($val <= 0): $content = str_replace('REPLACER', '

Díky za objednávku.

Jelikož jste objednali větší počet kusů, než bylo aktuálně k dispozici skladem, byl Vámi objednaný počet snížen.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
update_option(CF7_COUNTER, 0); // vynulovani pocitadla
update_option(CF7_LASTORD, 0); // vynulovani pocitadla
else:
$content = str_replace(‚REPLACER‘, ‚

Díky za objednávku.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚orderAlert‘);

### pridani odkazu na blog page k excerptum
function excerpt_read_more_link($output) {
global $post;
return $output . ‚Chyba: Kontaktní formulář nebyl nalezen.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚formRemover‘);

### Change content of Thank You Page
function orderAlert($content) {
if(!is_feed() && !is_admin() && is_page(72)) {
$val = get_option(CF7_COUNTER, POCNAB);
$poc = get_option(CF7_LASTORD, 0);
$roz = $poc-$val;
if($val <= 0): $content = str_replace('REPLACER', '

Díky za objednávku.

Jelikož jste objednali větší počet kusů, než bylo aktuálně k dispozici skladem, byl Vámi objednaný počet snížen.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
update_option(CF7_COUNTER, 0); // vynulovani pocitadla
update_option(CF7_LASTORD, 0); // vynulovani pocitadla
else:
$content = str_replace(‚REPLACER‘, ‚

Díky za objednávku.

Na adresu, kterou jste uvedli ve formuláři, byl zaslán potvrzující e-mail.

‚, $content);
endif;
}
return $content;
}
add_filter (‚the_content‘, ‚orderAlert‘);
\—

[/private]

Ve verzi CF7 4 a vyšší se způsob přebírání dat z formuláře změnil:
/—code php
/* WPCF7_ContactForm object no longer has a posted_data property. */
$posted_data = $contact_form->posted_data; // Tohle už nefunguje

/* Use WPCF7_Submission object’s get_posted_data() method to get it. */
$submission = WPCF7_Submission::get_instance();

if ( $submission ) {
$posted_data = $submission->get_posted_data();
}
\—

Změna umístění pozice obsahového editoru nebo metaboxu v administraci

**How to Move and Position The WordPress WYSIWYG Visual Editor**
„http://www.farinspace.com/move-and-position-wordpress-visual-editor/“:http://www.farinspace.com/move-and-position-wordpress-visual-editor/

**Move excerpt meta box to above content editor**
„http://wordpress.stackexchange.com/questions/137571/move-excerpt-meta-box-to-above-content-editor“:http://wordpress.stackexchange.com/questions/137571/move-excerpt-meta-box-to-above-content-editor

**Move custom meta box above editor**
„http://wordpress.org/support/topic/move-custom-meta-box-above-editor“:http://wordpress.org/support/topic/move-custom-meta-box-above-editor

Ochrana e-mailu před roboty

**CryptX**
„http://wordpress.org/plugins/cryptx/“:http://wordpress.org/plugins/cryptx/

No more SPAM by spiders scanning you site for email adresses. With CryptX you can hide all your email adresses, with and without a mailto-link, by converting them using javascript or UNICODE. You can choose to add a mailto-link to all unlinked email adresses with only one klick at the settings.

*

There is also a core WordPress function for it: antispambot().
The usage of the function is pretty simple:

/—code php

\—

But you can’t use PHP in your content (unless you’re using a plugin for that purpose). To use this function in your content, you can utilize a cool little shortcode like the one below. By using the shortcode above, you can cloak email addresses anywhere in your posts.

/—code php

), $atts ) );
return antispambot( $email );
}
add_shortcode( ‚antispambot‘, ‚antispambot_sc‘ );
// Usage: [antispambot email=“my.cloaked.email.address@gmail.com“]
?>
\—

*

případně

/—code php
function cwc_mail_shortcode( $atts , $content=null ) {
for ($i = 0; $i < strlen($content); $i++) $encodedmail .= "&#" . ord($content[$i]) . ';'; return '‚.$encodedmail.‘‚;
}
add_shortcode(‚mailto‘, ‚cwc_mail_shortcode‘);
\—

Použití shortcode:

[mailto]email@yourdomain.com[/mailto]

Widget pro zobrazení obsahu v záložkách

**WP Tab Widget**
„http://wordpress.org/plugins/wp-tab-widget/screenshots/“:http://wordpress.org/plugins/wp-tab-widget/screenshots/

AJAXified plugin which loads content (recent, popular, comments…) by demand, and thus it makes the plugin incredibly lightweight.

„Demo »“:http://demo.mythemeshop.com/truepixel/

[* http://ps.w.org/wp-tab-widget/assets/screenshot-2.png?rev=881259 *]

[* http://ps.w.org/wp-tab-widget/assets/screenshot-1.png?rev=881259 *]

Whiteboard framework

„Whiteboard framework“:http://whiteboardframework.com/ for WordPress was developed to speed up the development of WordPress themes. Whiteboard does so by eliminating the time spent on code common to all WordPress themes and includes non-intrusive code that improves the overall WordPress theme in many ways – including SEO, speed, usability, mobile support, and multi-lingual support.

Whiteboard is not like most other WordPress Frameworks out there. While most other WordPress Frameworks include a mess of styles, functions, and content areas that have to be cleaned out for nearly every project, Whiteboard remains a true WordPress Framework. Whiteboard includes only the core WordPress structure and does not get fancy with unnecessary functions. While Whiteboard does include Less Framework and a minimal theme.

WordPress návody přímo v administraci

**LifeGuard+**
„http://wplifeguard.com/lifeguard-plugin/“:http://wplifeguard.com/lifeguard-plugin/

The LifeGuard+ Assistant plugin puts WordPress video tutorials right into a WordPress Dashboard. Gone are the days where WordPress developers have to teach each new client how to use WordPress. Now all that needs to be done is install LifeGuard+ Assistant on all new client WordPress projects, and they can learn how to use WordPress by watching our thorough WordPress tutorials!