freshcreate
Forum Replies Created
-
Apparently, I had the old version of the plugin installed. I had to find the new one in the plugin repo. Found these options – perfect, thank you.
Forum: Plugins
In reply to: [Page scroll to id] Integration with a different scroll eventis(':animated')
did work! Brilliant – this is much cleaner. Thanks for teaching me something new. All the best.Forum: Plugins
In reply to: [Page scroll to id] Integration with a different scroll eventHi, the site is not public so I cannot share, and I actually did come up with a solution now, though it is hacky. I will share here anyway just in case you have ideas for improvement.
I realize it is outside the scope of your plugin, but it is related in some way and you may encounter this kind of scenario at some point.The idea is: when anchor link is clicked, create a temporary blank element, then remove it after a few seconds (when the animation is complete). Then, use a conditional for the sticky header script, checking if that temporary element exists. Like this:
// Add temporary element $('.links-container a').on('click', function() { $('.links-container').append('<div class="links-container-clicked"></div>'); setTimeout(function() { $('.links-container-clicked').remove(); }, 2000); }); let lastScrollPosition = 0; $(document).on('scroll', function(event) { const currentScrollPosition = $(this).scrollTop(); if (currentScrollPosition < lastScrollPosition) { // Scrolling up if($('.links-container-clicked').length == 0) { $('.header').addClass('header-visible'); } } else { // Scrolling down $('.header').removeClass('header-visible'); } lastScrollPosition = currentScrollPosition; });
Initially I was imagining using
event
somehow toreturn;
if the scroll was due to an anchor click, but maybe it’s not possible. I would prefer a cleaner solution that doesn’t involve the temporary element, but if it works it works ??Forum: Plugins
In reply to: [Redirection] Convert path to query parameterSorry I had a typo. The variations I have attempted are similar to:
^/specific-page/(.*)
TO
/specific-page?page_id=$1
I put
page_id=1234
in the example, instead ofpage_id=$1
.Brilliant, the temporary filter worked perfectly.
Many thanks for the prompt and stellar support.
Excellent, I appreciate you continuing to look into this. I’ve gone ahead and sent some details in your contact form. Note that the original dimensions are actually less than 4096px, but stands at 9.5mb before resizing/compression.
Hello, thanks for your thoughtful and detailed response. Please see my clarifications below:
The theme is custom, and indeed I do have Smush already implemented. Images rendered on the site itself are never the original, but rather one of the large/medium/thumbnmail versions. This way, if a contributor has an image at around 8000×6000 (common in stock photography), they don’t have to fuss over resizing/compressing in a photo editor – the theme handles that for them. This makes the post creation process foolproof and simplified. I suspect that this way of going about things isn’t so much a corner case, but I wouldn’t know for sure. Perhaps it is indeed atypical that a theme would allow larger images, ignoring the actual original.
You mentioned the “select image” feature, but I wasn’t referring to that. I was referring to the fact that the “Social Image URL” field defaults to the Featured Image url, in original size. The fact that it defaults there is really handy, as it takes a step away from the post creation workflow. But as you can see in my use case, since I am otherwise relying on the resized versions, the fact this plugin defaults to the original size poses a problem if the original happens to be huge.
At any rate, I wanted to clarify in case I was misunderstood in some way.
Please disregard the above message, it was an issue with my apache config.
Forum: Plugins
In reply to: [ACF qTranslate] Data from WYSIWYG is cleared when adding new repeater rowThis continues to be an issue for me. Anyone have any ideas?
Forum: Plugins
In reply to: [Page scroll to id] Scroll inside fixed divAh, got it. Thanks for letting me know!
Forum: Plugins
In reply to: [Simple Locator] Search from external page using query variableHere is how I pulled it off. Might be hacky, would be curious if someone knows of a better way:
//grab parameter from url function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } //if parameter exists, fill the search field with that parameter if (window.location.search.length) { $(".address-input input").val(getParameterByName("address")); } //prevent infinite loop that happens when triggering form click var count = 0; setTimeout(function() { if (count == 0) { $(".submit button").trigger('click'); count++; } }, 500);
This worked perfectly. Excellent support – many thanks!
I’ve sent you the details as requested. Thanks!
Thanks for your feedback.
By “posts attached”, do you mean there are links on the author page to other posts on the site? If so, some author pages do and some don’t, but it doesn’t correspond to who has
noindex
and who doesn’t. Please let me know if I’ve misinterpreted what you mean.Forum: Plugins
In reply to: [Page scroll to id] Seems incompatible with window.location.hash?Got it – thanks for the heads up on that.
Appreciate the offer but I can’t quite send a link since the site is in development and hidden from public.
I thought I found a workaround. My initial impression was that I had two groups: all non-delayed links would require the same offset amount, and delayed links would all require their own offset amount. So my workaround was to set
data-ps2id-offset
for the non-delayed links and have the default be the delayed link offset amount. I had it configured the opposite way.But as it turns out, I have different subsets in the non-delayed links, depending on their parent nav item, each grouping requires a different subset amount. I’m afraid this is become a little too dynamic for my own good ?? But I really wouldn’t want to sacrifice the smooth scroll functionality that you offer.
It becomes even more complicated by the fact that the delayed links are navigation items, so I had to add a function to add the
data-ps2id-offset
attribute, like so:add_filter( 'nav_menu_link_attributes', 'extra_atts', 10, 3 ); function extra_atts( $atts, $item, $args ) { $atts['data-ps2id-offset'] = '134'; $atts['rel'] = 'm_PageScroll2id'; return $atts; }
I do believe I’d be able to set attributes to nav items based on their parent, but I can’t pull it off unless I can take advantage of
data-ps2id-offset
on delayed links.I’m close to giving up, but figured I’d run my scenario by you and see if you have any ideas.