Disable comment rss feeds for pages in wordpress
Add this to functions.php add_filter(‘post_comments_feed_link’, ‘__return_null’);
Add this to functions.php add_filter(‘post_comments_feed_link’, ‘__return_null’);
This little plugin shows the user role ‘author’ only its own categories & posts. So you can edit it for your own post-type and taxonomy. /* Plugin Name: Show own categories Description: This plugin shows the user role ‘author’ only its own categories & posts Version: 0.1 Author: Soren Wrede License: GPL2 License URI: https://www.gnu.org/licenses/gpl-2.0.html … Read more
You haven’t specified where you want this alteration to apply to so I’ve applied it to just the home page. You may alter to fit where this filter applies to: <?php function wpse10691_alter_query( $query ) { if ( $query->is_main_query() && ( $query->is_home() || $query->is_search() || $query->is_archive() ) ) { $query->set( ‘orderby’, ‘modified’ ); $query->set( ‘order’, … Read more
Firstly, a POST request is the wrong type of request to send. As stated here, POST: Submits data to be processed to a specified resource You should be using GET, which Requests data from a specified resource The next problem is that in your callback function you are checking for $_POST[“pid”], but you are not … Read more
You want to use wp_ajax_nopriv_ for handling ajax for non-authenticated users: // logged-out users add_action( ‘wp_ajax_nopriv_my_action_search_key_press’, ‘action_search_key_press_callback’ ); // authenticated users add_action( ‘wp_ajax_my_action_search_key_press’, ‘action_search_key_press_callback’ );
Here is a slight variation of my other answer. First we register two new widget areas, sidebars in WordPress-speak. add_action( ‘widgets_init’, ‘wpse_84250_register_ad_widgets’ ); function wpse_84250_register_ad_widgets() { // used on the first page of main loop only register_sidebar( array ( ‘name’ => ‘Ad Widget 1’, ‘id’ => ‘ad_widget_1’, ‘before_widget’ => ‘<div class=”frontpage-ads”>’, ‘after_widget’ => ‘</div>’ ) … Read more
Since the plugin author does not offer any actions or filters for us to hook onto, we’ll have to settle for “listening” to changes to the views meta field instead. function wpse_104324_prevent_multiple_views( $meta_id, $object_id, $meta_key, $meta_value ) { if ( $meta_key === ‘views’ ) { if ( ! empty( $_COOKIE[ USER_COOKIE . ‘_views’ ] ) … Read more
Add the code to your comment template file or your functions.php with a page conditional. The comments file depends on your theme, by default it is comments.php , but it could be named anything, you need to look at your theme’s code. For example if it’s the contact page, if (is_page(‘Contact’)) // do something
You can send variables to your script with wp_localize_script: wp_enqueue_script( ‘some_handle’ ); global $post; $my_meta = get_post_meta( $post->ID, ‘my_meta’, true ); $array = array( ‘my_meta’ => $my_meta ); wp_localize_script( ‘some_handle’, ‘object_name’, $array ); You can then use the var in your script like: object_name.my_meta
$myterms = get_terms($taxonomies, $args); returns an array of term objects. Use $term->term_id as option value … “<option value=”$term->term_id”>”. esc_html( $term_name ) . “</option>” … and store that ID, not the name. Names can change, the IDs will stay the same – unless someone deletes a term and creates a new one with the same name. … Read more