tobiasmalikowski
Forum Replies Created
-
Just wanted to mention, maybe there is a better solution, but I have no suggestion at the moment. If you want make a note or just leave it as it is ??
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Filter by Category and TagsOne of the main problems is the way the shortcode works with this parameters:
'taxonomy' => 'reference_category:reference_tag', 'taxonomy_operator' => 'IN:IN', 'taxonomy_relation' => 'AND'
Since I have to define 2 taxonomies the plugin expects 2 values. So if I reset ALM I have to pass a category and a tag. But what if I want the user to be able to just select one tag without a category? Or one category and one or multiple tags?
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Filter by Category and TagsHi Darren,
I’m still working on combining categories and tags so users can choose one category and one or multiple tags to archive users to be ablte to:
- Filter by one category | Working
- Filter by one tag | Working
- Filter by multiple tags
- Filter by one category and multiple tags
Forum: Plugins
In reply to: [WordPress Infinite Scroll - Ajax Load More] Filter by Category and TagsWow w8 a moment, I just looked at your Shortcode Builder and tried to create a shortcode with the minimum requirement to display all references from one category.
But in the category field I only see the categories for my default post type (news) not my categories for the references. This might explain why I don’t get any results if I use data-category=”europe”!
But why can’t I see my categories for my custom post type “references”?
Update
Ok now I see my categories and tags are listed as taxonomies. So i guess category and tags are the WordPress default ones.Got the category switch working now with:
<ul id="alm-filter-nav"> <li> <a href="#" data-post-type="customer" data-repeater="loop-customer-archive.php" data-taxonomy="reference_category" data-taxonomy-operator="IN" data-taxonomy-terms="europe">Europe</a> </li> </ul>
Tags must work very similar, since its also a custom taxonomy. So it looks like the tricky part will be combining both, so the user can pick a category and/or one or multiple tags.
Forum: Plugins
In reply to: [Photoswipe Masonry Gallery] Unnecessary CSS Output – Performance ImproveHi again, I’ve just looked into your code and can see what you mean. You’re using PHP variables to set CSS depending on the options the users selected in the WordPress backend.
Suggestion #1
Why not add the styles which you need PHP for as inline styles, since you are generating the whole HTML in PHP this should no problem. This may not be the perfect solution (maybe there is a even cleaner solution) but since you just have a few PHP dependent styles this would reduce overhead by 95 %.Hi Darren,
I was able to solve this by changing my menu code to not fire any popstates.
So from my perspective this is resolved.However I suggest you to think about these parts of code.
Destroys the basic use of internal anchor links cause it always checks the url on a scroll event and removes added hashes! Thats not very nice ??
if(url !== permalink){ almPreviousPost.setURL(id, permalink, title); }
Shouldn’t this code also be disabled if the user decided to set the “Scroll to Post” setting to false?
var top = $('.alm-reveal.alm-previous-post.post-'+id).offset().top - almPreviousPost.offset + 5; $('html, body').animate({ scrollTop: top +'px' }, 1, function(){ almPreviousPost.popstate = false; });
If you want you can mark this as resolved (just leaving it open to make sure you read this last comment).
Update #2:
Ok now I now that the following code in alm-previous-post.js (line 143) is causing the page jump.var top = $('.alm-reveal.alm-previous-post.post-'+id).offset().top - almPreviousPost.offset + 5; $('html, body').animate({ scrollTop: top +'px' }, 1, function(){ almPreviousPost.popstate = false; });
Since this code gets executed on “popstate” it looks like that my script fires an “popstate” when I add that hash to the url.
Turned it off, so if I load a new post the window is not scrolling to the new post. But the bug remains.
If I open my menu, wich adds a #menu-open to the url the window jumps. But somehow the hash gets removed instantly and it looks like this is causing the jump. Could this come from your plugin? Cause the menu works on every page except my news pages, where I’m also using your plugin.
Update #1:
Ok now I now that the following of your code in alm-previous-post.js (line 68) removes my #menu-open url hash. But even when i comment that line out the jump still happens.if(url !== permalink){ almPreviousPost.setURL(id, permalink, title); }
Forum: Plugins
In reply to: [Photoswipe Masonry Gallery] Page Jump when closing the GalleryOk, I found out that this has to do with the URL Hash that Photoswipe is adding. So I’ve looked into the Photoswipe documentation and saw an option called “history” which can be set to false, so the URL Hash won’t be added.
After setting this option in “photoswipe-masonry.js” (line 52) my page is not jumping anymore!
So I’ve a feature request, since editing plugin core files is no best practice (cause changes get lost on updates), can you please add an option to your plugin (maybe same Place where your Plugin Settings are in WordPress Backend) which allows devs to set options for Photoswipe.
Should not be to complicated, just an Textarea, each line one key value pair, which get added in your JavaScript.
Here is a link to the Photoswipe Docs.
Thank you ??
Forum: Plugins
In reply to: [Photoswipe Masonry Gallery] AJAX and Photoswipe Masonry GalleryHi, now had time to test your updated code. Works like a charm.
I suggest you to add the usage to your documentation, so people know how to use it:// Execute Photoswipe-Masonry photoswipe_masonry($);
Hi Darren,
your latest update resolved the bug I’ve reported but there is still on bug which is very similar.
To reproduce the bug:
- Go to your example
- Click on Page 2 and watch the URL change to /page/2/
- Click on Page 3 and watch the URL change to /page/3/
- Use the Browser Back Button and watch the URL change to /page/2/
- Use the Browser Back Button and watch the URL still showing /page/2/
- Use the Browser Back Button and watch the URL change to /
So at Step 5 you have to hit the Back Button twice to get to page 1.
Forum: Plugins
In reply to: [Photoswipe Masonry Gallery] AJAX and Photoswipe Masonry GalleryHere is a Hotfix for all people trying to archive this.
Step 1: Pass WordPress plugin_url to your JavaScript
Do this while enqueuing your scripts.wp_enqueue_script( 'site-js', get_template_directory_uri() . '/assets/js/scripts.min.js', '', '', true ); wp_localize_script('site-js', 'siteJs', array( 'pluginsUrl' => plugins_url(), ));
Step 2: In your JavaScript you can now access the plugin url and load the whole Photoswipe-Masonry script on your AJAX callback.
// Load Photoswipe-Masonry Script and execute it, since it has no function to call instead var photoswipeMasonryUrl = siteJs.pluginsUrl + '/photoswipe-masonry/photoswipe-masonry.js'; $.getScript(photoswipeMasonryUrl, function(){});
However I’m still kindly asking you to implement this feature. It will make your code cleaner and more reusable.
Ok managed to solve it. So for everyone who needs to do the same. Use declare the variable you want to pass as global:
single.php
global $alm_original_post; $alm_original_post = true;
repeater-template.php
global $alm_original_post; if(!$alm_original_post) { // since the script is only called once the variable is only available // on the first call. So you can do stuff different for the first post. // I needed this to don't display the post image for the first post, // since my post-image is connected to the navigation. }
Hi Darren,
I’ve already read the docs and tried the available variables, but it won’t work in my situation, cause I’m using the previous post addon to load the posts one by one. So $alm_item is always 1.
I need to check if the post id that ALM is loading is the same as the post the user clicked on.
Ok got it!
Solution was so simple, just forgot to include the main parameter: ‘previous_post’ => ‘true’
Thanks for your quick help. I’ll mark this as resolved!