Nick C
Forum Replies Created
-
Forum: Plugins
In reply to: [Genesis Responsive Slider] Slider displays slides in columnsHi, LifeintheBush.
It looks as though you may have removed the slider widget now, but this CSS added to your theme’s stylesheet may solve this for you if you want to add the widget back:
.cafe-pro-home .content .one-widget .widget.genesis_responsive_slider { display: block; }Forum: Plugins
In reply to: [Genesis Simple Share] Uncaught ReferenceError: jQuery is not definedUnfortunately there is not a simple way to delay loading of inline scripts with Genesis Simple Share to account for deferred loading of jQuery. (It is possible, but would require editing the plugin.)
Your best options are to either:
- load jQuery without the defer attribute
- use a share plugin that does not require JavaScript, such as https://wordpress.org/plugins/fast-social-share-buttons/ or https://wordpress.org/plugins/naked-social-share/screenshots/ (with “disable JavaScript” enabled in the plugin’s options).
(Sorry for the confusion, Mauricio – I originally thought this topic was posted in the Genesis Responsive Slider forum.)
Forum: Plugins
In reply to: [Genesis Simple Share] Uncaught ReferenceError: jQuery is not definedEdit: Sorry, Mauricio – I cross-posted my original suggestion on the wrong plugin board.
I’ll take a look at Simple Share and async loading shortly…
Forum: Plugins
In reply to: [Genesis Simple Share] Uncaught ReferenceError: jQuery is not definedThanks for mentioning that you’re loading jQuery with the defer attribute, Mauricio. That sheds new light on this.
The error is appearing because the plugin’s inline script will be loaded before jQuery. To work around this, you could defer loading of inline scripts by removing them and adding them after jQuery has loaded. One way to do that is to add this code to your active theme’s functions.php file:
add_action( 'after_setup_theme', 'defer_genesis_responsive_slider', 16 ); function defer_genesis_responsive_slider() { remove_action( 'wp_footer', 'genesis_responsive_slider_flexslider_params' ); add_action( 'wp_footer', 'custom_genesis_responsive_slider_flexslider_params' ); } function custom_genesis_responsive_slider_flexslider_params() { $timer = ( int ) genesis_get_responsive_slider_option( 'slideshow_timer' ); $duration = ( int ) genesis_get_responsive_slider_option( 'slideshow_delay' ); $effect = genesis_get_responsive_slider_option( 'slideshow_effect' ); $controlnav = genesis_get_responsive_slider_option( 'slideshow_pager' ); $directionnav = genesis_get_responsive_slider_option( 'slideshow_arrows' ); $output = 'function sliderDefer(method) { if (window.jQuery) method(); else setTimeout(function() { sliderDefer(method) }, 50); } function sliderParams(){ jQuery(document).ready(function($) { $(".flexslider").flexslider({ controlsContainer: "#genesis-responsive-slider", animation: "' . esc_js( $effect ) . '", directionNav: ' . $directionnav . ', controlNav: ' . $controlnav . ', animationDuration: ' . $duration . ', slideshowSpeed: ' . $timer . ' }); }); } sliderDefer( sliderParams ); '; $output = str_replace( array( "\n", "\t", "\r" ), '', $output ); echo '<script type=\'text/javascript\'>' . $output . '</script>'; }That will defer loading of the inline slider script until after jQuery is loaded, and should prevent the error you were seeing.
Forum: Plugins
In reply to: [Genesis Simple Share] Uncaught ReferenceError: jQuery is not definedHi, Mauricio.
Can you share a link to a page that displays this error, please? It sounds like there may be two versions of jQuery included on the page.
Great to hear the plugin was helpful!
Yes, you can safely delete the plugin once you’ve finished migrating your data.
Forum: Plugins
In reply to: [Genesis Simple Share] LinkedIn Share Button ConflictMany thanks for sharing the link, Bart. From the raw LinkedIn data at http://d.pr/12Uch I can see the post should have six shares.
Do you see any errors in your server logs? The latest version of the plugin uses PHP to check LinkedIn counts instead of JavaScript, and remote PHP requests can cause issues with security filters on certain servers.
Forum: Plugins
In reply to: [Genesis Simple Share] LinkedIn Share Button ConflictThanks for letting us know this solved things for you all.
@bart van Maanen The twitter count is currently not available, but you should still see counts for LinkedIn as long as your server supports the new method we’re using to get the data.
I’m seeing counts on the LinkedIn button on this post: http://bartvanmaanen.nl/wordt-verwacht-meer-toekomst/. If there was another post you were having trouble with, please feel free to share a link.
Forum: Plugins
In reply to: [Genesis Simple Share] LinkedIn Share Button ConflictThanks for the report, fanalejr.
It looks as though LinkedIn may have changed their API to no longer accept punctuation or numbers as part of the count API URL. I couldn’t find any documentation to confirm this, but these requests fail:
Where as this one succeeds:
I’ve logged this issue with the StudioPress team, and a fix is being tested.
Hi, tmarsh1.
When you visit a link that does not exist, WordPress first attempts to find a correct similar-looking URL before it returns a 404.
That’s why visiting any of these links will 301 redirect to http://www.velonomad.com/go/wiggle-2xu-calf/, even though you have not defined them as short links in the Simple URLs settings:
- http://www.velonomad.com/go/wiggle-2
- http://www.velonomad.com/go/wiggle-2x
- http://www.velonomad.com/go/wiggle-2xu
- http://www.velonomad.com/go/wiggle-2xu-
- http://www.velonomad.com/go/wiggle-2xu-c
- http://www.velonomad.com/go/wiggle-2xu-ca
- http://www.velonomad.com/go/wiggle-2xu-cal
WordPress sees that those links are nearly the same as
wiggle-2xu-calf, and – provided you don’t also have a post with one of the shorter names – it assumes you mean the longer version instead.e.g.
➜ curl -I http://www.velonomad.com/go/wiggle-2xu HTTP/1.1 301 Moved Permanently ... Location: http://www.velonomad.com/go/wiggle-2xu-calf/You can see the WordPress core code responsible for this here: https://github.com/WordPress/WordPress/blob/c8325e1ab5167aaae8d1a11cefa3a627710ecb7c/wp-includes/canonical.php#L580 (it uses a
post_name LIKEquery to find similar post names).There’s a request for an option to remove the URL guessing feature here that may make it into a future version of WordPress: https://core.trac.wordpress.org/ticket/16557
For now, you can use this plugin if you’d like to disable URL guessing to prevent those redirects: https://wordpress.org/plugins/disable-url-autocorrect-guessing/
With that plugin active, partial URLs will then 404 instead of 301 redirecting.
Forum: Plugins
In reply to: [AgentPress Listings] Put a clickable URL on Property DetailsHi!
Listings meta data is filterable to turn text into clickable links, but by default the
[property_details]shortcode escapes HTML, so your clickable link would appear as<a href="http://example.com" rel="nofollow">http://example.com</a>instead of http://example.com.To work around this, you could write your own
[custom_property_details]shortcode that prevents HTML from being escaped. You could do it like this:1. Take a full backup of your site.
2. Add the following code to your active theme’s functions.php file:
//* Make listing_url post meta value a clickable link add_filter( 'get_post_metadata', 'sp_filter_listing_link', 10, 4 ); function sp_filter_listing_link( $meta_value, $object_id, $meta_key, $single ) { if ( is_admin() || ! isset( $meta_key ) || '_listing_url' != $meta_key ) { return null; } $meta_cache = wp_cache_get($object_id, 'post_meta'); if ( !$meta_cache ) { $meta_cache = update_meta_cache( 'post', array( $object_id ) ); $meta_cache = $meta_cache[$object_id]; } if ( isset($meta_cache[$meta_key]) ) { $value = maybe_unserialize( $meta_cache[$meta_key][0] ); return make_clickable( $value ); } } //* Add a [custom_property_details] shortcode to prevent HTML links from being escaped add_shortcode( 'custom_property_details', 'custom_property_details_shortcode' ); function custom_property_details_shortcode( $atts ) { global $post; $property_details = apply_filters( 'agentpress_property_details', array( 'col1' => array( __( 'Price:', 'agentpress-listings' ) => '_listing_price', __( 'Address:', 'agentpress-listings' ) => '_listing_address', __( 'City:', 'agentpress-listings' ) => '_listing_city', __( 'State:', 'agentpress-listings' ) => '_listing_state', __( 'ZIP:', 'agentpress-listings' ) => '_listing_zip' ), 'col2' => array( __( 'MLS #:', 'agentpress-listings' ) => '_listing_mls', __( 'Square Feet:', 'agentpress-listings' ) => '_listing_sqft', __( 'Bedrooms:', 'agentpress-listings' ) => '_listing_bedrooms', __( 'Bathrooms:', 'agentpress-listings' ) => '_listing_bathrooms', __( 'Basement:', 'agentpress-listings' ) => '_listing_basement' ) ) ); $output = ''; $output .= '<div class="property-details">'; $output .= '<div class="property-details-col1 one-half first">'; foreach ( (array) $property_details['col1'] as $label => $key ) { $output .= sprintf( '<b>%s</b> %s<br />', esc_html( $label ), get_post_meta( $post->ID, $key, true ) ); } $output .= '</div><div class="property-details-col2 one-half">'; foreach ( (array) $property_details['col2'] as $label => $key ) { $output .= sprintf( '<b>%s</b> %s<br />', esc_html( $label ), get_post_meta( $post->ID, $key, true ) ); } $output .= '</div><div class="clear">'; $output .= sprintf( '<p><b>%s</b><br /> %s</p></div>', __( 'Additional Features:', 'agentpress-listings' ), get_the_term_list( $post->ID, 'features', '', ', ', '' ) ); $output .= '</div>'; return $output; }3. Replace the
[property_details]shortcode in your listing with[custom_property_details].You should then find that URLs you enter into your custom
_listing_urlfield become clickable links on the front end.Forum: Plugins
In reply to: [AgentPress Listings] Two questions about customizing this plugin…Hi, David!
how do I change the text from “View Listing” in the Featured Listings widget to something else
There is currently no option to change this without editing the plugin, unfortunately. Sorry about the inconvenience there.
how do I change the size of the search boxes in the Listing Search widget?
You can do that by adding CSS to your theme. The exact CSS you use can depend on your theme. For example, if you wanted to make the search boxes smaller in AgentPress Pro (http://demo.studiopress.com/agentpress/ ), you could use this code in your theme’s style.css file:
select.agentpress-taxonomy { padding: 10px; }That will reduce the white space around the select fields to make them smaller. If that doesn’t work for your site, you’re welcome to link to it and let me know how you’d like to change the search boxes. I’d be happy to offer some quick pointers.
Forum: Plugins
In reply to: [AgentPress Listings] Display listings in a page or post?Hi, dme102.
So sorry for the late response – I missed your original request here.
I’ve passed your feedback on as a feature request to the StudioPress team. For now, you could consider using a plugin such as this one: https://wordpress.org/plugins/display-posts-shortcode/
That plugin will allow you to insert basic details about a specific listing with a shortcode like this:
[display-posts post_type="listing" id="123" include_excerpt image_size="medium" wrapper="div"]That will display a title, image, and excerpt for a listing with ID of 123. The listing ID is visible in the address bar when editing your listing: http://d.pr/i/SU7R
You may need to style the content with some custom CSS in your theme, but hopefully that proves helpful as a starting point.
Forum: Plugins
In reply to: [AgentPress Listings] Error with ListingsHi, brownmarketer.
Sorry to hear that!
I tested the latest version of the plugin and I’m able to add media to my listings. It sounds like a possible theme or plugin conflict to me. Some options you could explore include:
1. Taking a full site backup first.
2. Disabling all other plugins temporarily.
3. Switching to the default Genesis theme temporarily to rule out issues with your child theme.
4. Re-installing WordPress.
5. Looking for errors in your browser console on the listings admin page when clicking the Add Media button. (Here’s a quick guide to opening the Console in your browser: http://webmasters.stackexchange.com/a/77337/7198 )Hopefully one of these ideas may help to pinpoint the issue for you.
Forum: Plugins
In reply to: [Genesis Simple Share] Lost Google share counts after hosting migrationHi, Raquel.
The Google+ button uses a PHP script in order to retrieve counts, so it can be more sensitive to hosting environment changes.
Some hosts impose a setting called an “open_basedir restriction” that can prevent the Google+ button counts from working. If this is affecting you, you’ll see an error in your logs such as this one:
CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set...Do you see any error messages in your logs on the new server that look like this? It would be worth approaching your hosting company for advice if so.