Front-end registration form with password field

If you were to use a plugin that uses shortcode you can call it in your template by using this in your template: <?php echo do_shortcode (‘[your-shortcode]’); ?> You can also do something similar to this form / code below for a front end login: <form method=”post” action=”<?php bloginfo(‘url’) ?>/wp-login.php” class=”wp-user-form”> <div class=”username”> <label for=”user_login”><?php … Read more

Create a link which allows visitors to disable a plugin?

According to the code … // Embed Switch Links in Theme Via Shortcode // [show_theme_switch_link] function show_theme_switch_link_func( $atts ){ $desktopSwitchLink = get_option(‘show_switch_link_for_desktop’); global $shown_theme; global $status; if ($shown_theme){ $return = ‘<a rel=”external” data-ajax=”false” href=”‘.get_bloginfo(‘url’).’?am_force_theme_layout=desktop” class=”am-switch-btn godesktop”>’.get_option(‘desktop_view_theme_link_text’).'</a>’; } else { if ((!empty($status)) || ($desktopSwitchLink == ‘yes’)){ $return = ‘<a href=”‘.get_bloginfo(‘url’).’?am_force_theme_layout=mobile” class=”am-switch-btn gomobile”>’.get_option(‘mobile_view_theme_link_text’).'</a>’; } } return $return; … Read more

Post visibility option to theme front-end for author to select?

Wherever you want to provide this functionality, put the following: <?php if (is_user_logged_in() && current_user_can(‘publish_posts’)) { $ID = get_the_ID(); $status = get_post_status($ID); ?> Visibility: <form id=”update_post_visibility” name=”update_post_visibility” method=”post” action=”/update-post-visibility”> <input id=”visibility-radio-public” type=”radio” <?php if ((‘publish’ === $status) && ! post_password_required($ID)) echo ‘checked=”checked” ‘; ?>value=”public” name=”visibility” /> <label for=”visibility-radio-public”>Public</label> <br /> <input id=”visibility-radio-password” type=”radio” <?php if … Read more

How to auto strip hyperlinks & images in wordpress post

Here is one idea to strip link- and image tags from the post content (before you save it) by using the edit_post_content filter and the wp_kses function: add_filter( ‘edit_post_content’, ‘my_edit_post_content’, 10, 1 ); function my_edit_post_content( $content ) { if (!current_user_can(‘manage_options’)) { // only strip for non-admins global $allowedposttags; $mytags = $allowedposttags; unset($mytags[‘a’]); // don’t allow … Read more

Assigning tags to a post from front end using tag-it jquery UI plugin

I added the fieldName parameter to tagit function like this: <script type=”text/javascript”> $(document).ready(function() { $(“#myTags”).tagit( { fieldName: “tages[]” } ); }); </script> Now I can echo $_POST[‘tages’]; since the HTML after execution became: <input type=”hidden” style=”display:none;” value=”d” name=”tages”> In addition, $_POST[‘tages’]; is a PHP array which I can directly put in second parameter of wp_set_object_terms. … Read more

Front end posting

You can not use wp_redirect() if the headers have already been sent so snippet you provided should not be used within your template files, instead you should wrap it within a function and place it into your functions.php file and hook onto template_redirect action. Example: add_action(‘template_redirect’, ‘front_end_post’, 99); function front_end_post() { if( ‘POST’ == $_SERVER[‘REQUEST_METHOD’] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)