mtgpuzzles
Forum Replies Created
-
Thanks. For the novice programmer, could you elaborate a little further on how exactly this would be implemented?
Right now I’m not even using the custom function in my OP, just the built in ga function as an onclick in the href tag in core_actions.php:
<a href … onclick=”ga(‘send’, ‘event’, ‘outbound’, ‘click’, url, {
‘transport’: ‘beacon’,
‘hitCallback’: function(){document.location = url;});” …>(Where in fact all my ‘ characters are currently written out as & # 0 3 9 ; )
Would I need to actually make my own function now? From your example here, I’m a little unsure of what does what.
Thanks!
Okay, to fully close the loop, I discovered that the issue of editing the ga function into core_actions.php is that Javascript needs the ‘ character to properly bound its variables, and php is seeing them as part of its code, so they were getting confused.
I had to instead replace the ‘ with its ASCII code & # 0 3 9 ; (without spaces)
The code looks totally ridiculous as a result, but (somewhat to my surprise), it worked!
- This reply was modified 8 years, 7 months ago by mtgpuzzles.
- This reply was modified 8 years, 7 months ago by mtgpuzzles.
Nevermind, I believe I figured it out using the ga(‘send”,….); function directly. I guess I’ll know when events start working.. or not. 🙂
Forum: Plugins
In reply to: [Collapse-O-Matic] Expands on page load if post preview is a search resultThanks! It took me a little while to figure out how to enqueue the JS in my child theme, but found that part of the answer here:
https://teamtreehouse.com/community/wordpress-how-to-enqueue-script-to-child-theme
Thanks again!!
Forum: Plugins
In reply to: [Collapse-O-Matic] Expands on page load if post preview is a search resultYep.
Go to the URL, you’ll see the default load being a number of recent posts.
Then click one of the filter options on the right. After it does its thing (autoload/AJAX), the filtered results will show up.
Usually the results will still have the expanded text hidden this first time, but then if you click another filter, usually all the results now will have the expanded text showing.
Is this a callback thing like I’ve seen in other threads? If so, I have no idea how to implement it :/ But I am using a child theme of twentyeleven.
Thanks!