Přehled odpovědí
-
AutorPříspěvky
-
Dobrý den,
od dodavatele se načítají katalogová č. která mají 8 míst. Pro heureku je potřeba ean o 13 místech. Jak se to dá vyřešit?
Děkuji
Nastavuji to pomocí funkcí. Rád bych se obešel bez pluginu. Váš kód mi hází chybu, ale i tak děkuji za Váš čas.
Děkuji za odpověď. Zkoušel jsem toto, ale stále jde smazat stránka, která je nastavena jako hlavní stránka webu.
`’delete_pages’ => false,
‘delete_private_pages’ => false,
‘delete_published_pages’ => false,
‘edit_others_pages’ => true,
‘edit_pages’ => true,
‘edit_private_pages’ => true,
‘edit_published_pages’ => true,
‘publish_pages’ => true,Díky za názor. Souhlasím.
Do šablony vkládám víceméně jen jednoduché pluginy jako třeba https://wordpress.org/plugins/pagination/ u kterých v podstatě není možná další aktualizace nebo je dál upravuji.
Proč je lepší nemít plugin přímo v šabloně? Kromě nutných úprav při změně šablony.
Tak jsem zkusil přepsat
WPLANG
zcs_CZ
nacs_cz
a čeština funguje. Nechápu sice proč když to vždycky fungovalo i s velkým písmem, ale jede to.Jde o verzi 3.5.1 kde v Nastavení – obecné není možné zvolit jazykovou verzi. Zároveň by na této verzi ještě mělo fungovat
WPLANG
nebo ne? Potřebuji mít instalovanou právě tuto verzi.Nemáš komentáře smazané v šabloně?
Díky. Funguje to.
Díky za reakci. Potřebuji i odlišné položky ve formuláři. Jiné pro příspěvky a jiné pro stránky. Hledám jestli by šlo udělat kopii comments.php, upravit a vložit do page.php např. jako comments_1.php. Pokud někdo znáte řešení předem díky za radu.
Jak se dá povolit konkrétní plugin podle role? Našel postup pro konkrétní plugin http://highedwebtech.com/2011/12/16/wordpress-giving-editors-access-to-gravity-forms/ ale nevím jak to upravit pro jiný plugin. Díky.
Díky za reakci. Kompletní kód vypadá takto:
<?php //If the form is submitted if(isset($_POST['submitted'])) { //Check to see if the honeypot captcha field was filled in if(isset($_POST['checking']) && (trim($_POST['checking']) !== '')) { $captchaError = true; } else { //Check to make sure that the name field is not empty if(trim($_POST['contactName']) === '') { $nameError = __('Zadejte Vaše jméno.','smooth'); $hasError = true; } else { $name = trim($_POST['contactName']); } //Check to make sure sure that a valid email address is submitted if(trim($_POST['email']) === '') { $emailError = __('Zadejte Váš e-mail.','smooth'); $hasError = true; } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) { $emailError = __('Zadejte platný formát e-mailu.','smooth'); $hasError = true; } else { $email = trim($_POST['email']); } //Check to make sure comments were entered if(trim($_POST['comments']) === '') { $commentError = __('Zapoměli jste zadat Vaši zprávu.','smooth'); $hasError = true; } else { if(function_exists('stripslashes')) { $comments = stripslashes(trim($_POST['comments'])); } else { $comments = trim($_POST['comments']); } } //If there is no error, send the email if(!isset($hasError)) { $user_email = get_post_meta($post->ID, '_email', true); $emailTo = get_the_author_meta('user_email').','.$user_email; $subject = __('Zpráva z webu od ','smooth').$name; $sendCopy = trim($_POST['sendCopy']); $body = "Name: $name \n\nEmail: $email \n\nComments: $comments \n\nURL: $url"; $headers = __('From: ','smooth').get_bloginfo('name').' <'.$emailTo.'>' . "\r\n" . __('Reply-To: ','smooth') . $email; wp_mail($emailTo, $subject, $body, $headers); if($sendCopy == true) { $subject = __('You emailed Your ','smooth').get_bloginfo('name'); $headers = __('From: ','smooth').get_the_author_meta('user_email'); wp_mail($email, $subject, $body, $headers); } $emailSent = true; } } } ?> <?php if(isset($emailSent) && $emailSent == true) { ?> <div class="thanks"> <strong><?php _e('Děkujeme, ','smooth');?><?php echo '<span class="font-width:bold!important">'.$name.'</span>';?></strong> <p><?php _e('Vaše zpráva byla úspěšně odeslána.<br/> Budeme Vás kontaktovat.','smooth');?></p> </div> <?php } else { ?> <?php global $post; if(isset($hasError) || isset($captchaError)) { ?> <p class="error"><?php _e('Vyplňte prosím všechna pole.','smooth');?><p> <?php } ?> <form action="<?php the_permalink(); ?>" class="agent-contact-form print" method="post"> <p><input type="text" name="contactName" id="name-bar" value="Jméno<?php if(isset($_POST['contactName'])) echo $_POST['contactName'];?>" class="requiredField input-bar " /></p> <?php if(isset($nameError) == ''){ ?> <span class="error"><?php $nameError;?></span> <?php } ?> <p><input type="text" name="email" id="email-bar" value="E-mail<?php if(isset($_POST['email'])) echo $_POST['email'];?>" class="requiredField email input-bar" /></p> <?php if(isset($emailError) == ''){ ?> <span class="error"><?php $emailError;?></span> <?php } ?> <p><textarea name="comments" id="commentsText" class="requiredField message-box"><?php if(isset($_POST['comments'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['comments']); } else { echo $_POST['comments']; } } ?><?php _e('Mám zájem o více informací k ','smooth');?><?php echo $post->post_title ?></textarea></p> <?php if(isset($commentError) == ''){ ?> <span class="error"><?php $commentError;?></span> <?php } ?> <input type="submit" name="submitted" class="send-btn" value="Odeslat" /></p> </form> <?php } ?>
Zkoušel jsem ho upravit podle toho co jste mi napsal, ale url na email nepřijde. Kód jsem upravil takto:
<?php //If the form is submitted if(isset($_POST['submitted'])) { //Check to see if the honeypot captcha field was filled in if(isset($_POST['checking']) && (trim($_POST['checking']) !== '')) { $captchaError = true; } else { //Check to make sure that the name field is not empty if(trim($_POST['contactName']) === '') { $nameError = __('Zadejte Vaše jméno.','smooth'); $hasError = true; } else { $name = trim($_POST['contactName']); } //Check to make sure sure that a valid email address is submitted if(trim($_POST['email']) === '') { $emailError = __('Zadejte Váš e-mail.','smooth'); $hasError = true; } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) { $emailError = __('Zadejte platný formát e-mailu.','smooth'); $hasError = true; } else { $email = trim($_POST['email']); } //Check to make sure comments were entered if(trim($_POST['comments']) === '') { $commentError = __('Zapoměli jste zadat Vaši zprávu.','smooth'); $hasError = true; } else { if(function_exists('stripslashes')) { $comments = stripslashes(trim($_POST['comments'])); } else { $comments = trim($_POST['comments']); } } //If there is no error, send the email if(!isset($hasError)) { $user_email = get_post_meta($post->ID, '_email', true); $emailTo = get_the_author_meta('user_email').','.$user_email; $subject = __('Zpráva z webu od ','smooth').$name; $sendCopy = trim($_POST['sendCopy']); $body = "Name: $name \n\nEmail: $email \n\nComments: $comments \n\nURL: $url"; $headers = __('From: ','smooth').get_bloginfo('name').' <'.$emailTo.'>' . "\r\n" . __('Reply-To: ','smooth') . $email; $url=$_POST['acturl']; wp_mail($emailTo, $subject, $body.'<br/>Odesláno z URL '.$url, $headers); if($sendCopy == true) { $subject = __('You emailed Your ','smooth').get_bloginfo('name'); $headers = __('From: ','smooth').get_the_author_meta('user_email'); wp_mail($email, $subject, $body, $headers); } $emailSent = true; } } } ?> <?php if(isset($emailSent) && $emailSent == true) { ?> <div class="thanks"> <strong><?php _e('Děkujeme, ','smooth');?><?php echo '<span class="font-width:bold!important">'.$name.'</span>';?></strong> <p><?php _e('Vaše zpráva byla úspěšně odeslána.<br/> Budeme Vás kontaktovat.','smooth');?></p> </div> <?php } else { ?> <?php global $post; if(isset($hasError) || isset($captchaError)) { ?> <p class="error"><?php _e('Vyplňte prosím všechna pole.','smooth');?><p> <?php } ?> <form action="<?php the_permalink(); ?>" class="agent-contact-form print" method="post"> <input type="hidden" name="acturl" value="<?php echo $url; ?>"> <p><input type="text" name="contactName" id="name-bar" value="Jméno<?php if(isset($_POST['contactName'])) echo $_POST['contactName'];?>" class="requiredField input-bar " /></p> <?php if(isset($nameError) == ''){ ?> <span class="error"><?php $nameError;?></span> <?php } ?> <p><input type="text" name="email" id="email-bar" value="E-mail<?php if(isset($_POST['email'])) echo $_POST['email'];?>" class="requiredField email input-bar" /></p> <?php if(isset($emailError) == ''){ ?> <span class="error"><?php $emailError;?></span> <?php } ?> <p><textarea name="comments" id="commentsText" class="requiredField message-box"><?php if(isset($_POST['comments'])) { if(function_exists('stripslashes')) { echo stripslashes($_POST['comments']); } else { echo $_POST['comments']; } } ?><?php _e('Mám zájem o více informací k ','smooth');?><?php echo $post->post_title ?></textarea></p> <?php if(isset($commentError) == ''){ ?> <span class="error"><?php $commentError;?></span> <?php } ?> <input type="submit" name="submitted" class="send-btn" value="Odeslat" /></p> </form> <?php } ?>
Předem díky za pomoc.
-
AutorPříspěvky