Remove the More Link

You need a filter on the_content_more_link. else { // They aren’t in the paying group function strip_more_link($link,$linktext) { remove_filter(‘the_content_more_link’,’strip_more_link’,1); return $linktext; } add_filter(‘the_content_more_link’,’strip_more_link’,1,2); global $more; $more = 0; the_content(‘<b>Interested in reading the rest of this article? You just be a subscriber to continue reading.</b>’); } It may be more efficient, or neater, to write a … Read more

Shortcode to find and replace URL

Your shortcode function should look like this: function replace_url_for_nonlogged( $atts, $content = “”) { if ( is_user_logged_in () ) return $content; extract( shortcode_atts( array( ‘replace’ => ‘http://www.default_replace_url.com’, ), $atts ) ); $pattern = ‘/href=(“|\’)((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)(“|\’)/’; return preg_replace($pattern, “href=\”$replace\””, $content); } add_shortcode( ‘scode’, ‘replace_url_for_nonlogged’ ); Then you can use the shortcode like this: [scode]Lorem <a href=”http://reservedurl.com”>ipsum</a> dolor … Read more

Fatal error: Call to undefined function register_new_user()

I greped a 3.6 install and got this: ./wp-login.php:321:function register_new_user( $user_login, $user_email ) { ./wp-login.php:550: $errors = register_new_user($user_login, $user_email); Notice the function definition is in wp-login.php. If you look at the current wp-login.php, it isn’t there anymore and there is a note at the top of the page, just above the code: Last change on … Read more

Hide image if taxonomy term is empty

Instead of write manually the html code for your flags, you should create it using php and wordpress functions: $countries = get_terms(‘country’, array(‘hide_empty’ => true) ); $exclude_terms = array(‘featured’); if ( ! empty($countries) && is_array($countries) ) { ?> <img class=”mapAdjust” src=”https://wordpress.stackexchange.com/questions/114245/<?php bloginfo(“template_url’); ?>/img/map-adjust.gif” /> <img class=”map” src=”https://wordpress.stackexchange.com/questions/114245/<?php bloginfo(“template_url’); ?>/img/map.jpg” /> <?php foreach ( $countries as … Read more

2nd page displaying the exact same posts as my first page (minus the very first post)

Solution 1 It looks like this might be what is happening to your template: http://codex.wordpress.org/Pagination#Adding_the_.22paged.22_parameter_to_a_query Basically what it’s saying is that the second page doesn’t realize it’s the second page because the “paged” parameter is missing. I’ve just copied directly from the wordpress documentation, which says you should do this: <?php $paged = (get_query_var(‘paged’)) ? … Read more

Metabox Not saving data

I optimized your function. <?php function dd_hctb_create() { add_meta_box (‘dd_meta’, ‘Heading Content Text Box’, ‘dd_hctb_cb’, ‘page’, ‘normal’, ‘high’); } // function dd_hctb_create add_action(‘add_meta_boxes’, ‘dd_hctb_create’); function dd_hctb_cb($post) { wp_nonce_field(basename(__FILE__), ‘dd_mbe_content_nonce’); //retrieve the metadata values if they exist $value = get_post_meta($post->ID, ‘dd_mbe_content’, true); ?> <p> Write any content in here that you want to appear above the … Read more

How to solve Woocommerce Memory Limit

You could also try toying with the max memory limit. I think it’s far more likely you are on an EIG host and throttled to a 64mb limit. Oh one more thing, it’s define( ‘WP_MEMORY_LIMIT’, ‘128M’ );

Custom ajax call returns 0 [duplicate]

Modify your registerform() function to include die() after you echo your response. Example: function registerform(){ echo $_POST[‘name’]; die(); } add_action(‘wp_ajax_registerform’, ‘registerform’); add_action(‘wp_ajax_nopriv_registerform’, ‘registerform’);