pedjas
Forum Replies Created
-
Forum: Plugins
In reply to: [Media Library Assistant] Showing uploaded photos on user profileI tried again. If I change user form Contributor to Administator, nothing changes. It still shows all media on that user profile.. not filtered by user.
However, i did found this: if user has at least one post, then MLA shows photos properly. Only for users that have only photos but not posts, it shows all photos – not filtered by user.
[mla_gallery author="{+page_author+}" attachment_category='photographs' columns=4 orderby="date DESC" posts_per_page=24 size=thumbnail mla_caption='{+title+}<br>Фото: <a href="{+site_url+}/author/{+author:user_nicename+}">{+author+}/</a>' ] [mla_gallery author="{+page_author+}" attachment_category='photographs' posts_per_page=24 mla_output="paginate_links,prev_next"]
- This reply was modified 1 year, 7 months ago by pedjas.
Forum: Plugins
In reply to: [Advanced Query Loop] Undefined index: queries on query-loop.php on line 23Not it reprots similar error but for meta_query
Notice: Undefined index: meta_query in /public_html/wp-content/plugins/advanced-query-loop/includes/query-loop.php on line 78
This is Advanced Query Loop code
<!-- wp:query {"queryId":0,"query":{"perPage":"36","pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"date_query":"","multiple_posts":[]},"displayLayout":{"type":"flex","columns":3},"namespace":"advanced-query-loop","editorskit":{"devices":false,"desktop":true,"tablet":true,"mobile":true,"loggedin":true,"loggedout":true,"acf_visibility":"","acf_field":"","acf_condition":"","acf_value":"","migrated":false,"unit_test":false},"boldblocks":{"grid":{"columns":{"lg":{"value":"none","inherit":null},"md":{"inherit":"lg"},"sm":{"inherit":null}},"gap":{"lg":{"value":{"row":"1rem","column":"1rem"},"inherit":null},"md":{"inherit":"lg"},"sm":{"inherit":"lg"}}},"carousel":{"speed":300,"effect":{"name":"slide","settings":{}},"loopType":"infinite","autoplay":{"enable":true,"delay":3000},"slidesPerView":1,"spaceBetween":0,"enableResponsive":false,"breakpoints":{"lg":{"value":{"slidesPerView":4,"spaceBetween":0},"inherit":null},"md":{"inherit":"lg"},"sm":{"inherit":"lg"}},"pagination":{"enable":true,"size":"12px","spacing":"10px","color":"","inactiveColor":"","opacity":0.3,"dynamicBullets":true,"horizontalGap":"5px"},"navigation":{"enable":false,"size":"44px","spacing":"10px","color":""}}}} -->
- This reply was modified 1 year, 7 months ago by pedjas.
Forum: Plugins
In reply to: [Media Library Assistant] Showing uploaded photos on user profileSorry, my bad, other users are Contributors, not Subscribers. All photos do have proper users set as authors.
I will try debugging, maybe it reveals something.Forum: Developing with WordPress
In reply to: How ti get values from posts in archive loop?Thanks I wil try this but I do except another kind of aproblem. My site content is in Cyrillic script and i created plugin that runs transliteration to Latin per request. But transliteration can be done only on generated HTML content. Any content generated by JavaScript is done after transliteration is done and it cannot be transliterated.
Anyways, this is interesting so I will try it.All this complications are result of lack or natural support for displaying custom fields in WP core. I have to make custom code just to be able to get values for displaying.
Forum: Plugins
In reply to: [Open Graph and Twitter Card Tags] Default image for custom post type?I am joining this request.
It is quite odd when link to post archive is posted on FB, FB collects and displays all info like main page is linked (title, description and image), excepts link itself is not root url but actual archive page. That is very confusing for users.
It should provide specific title and description for that archive and possibly image.It would be much better if we can separate default image for each post type, or at least to have option that plugin does not set ogg fields in header for selected post type archives so we can deal with it by custom code, and avoid conflicts.
Forum: Developing with WordPress
In reply to: How ti get values from posts in archive loop?I guess that is viable explanation.
Too bad, as making blocks is so complicated…
Forum: Developing with WordPress
In reply to: How ti get values from posts in archive loop?Thanks!
global $post; $id = $post->ID;
did not work.
It does the same, executes only once in a template, collects value from the first post in loop, and use that value for all posts.Second example is not applicable to my case. I have Block Theme and Block QueryLoop. I have to use hooks or shortcodes to get what I want.
If it was not Block Theme, it would be easy.
- This reply was modified 1 year, 7 months ago by pedjas.
Forum: Plugins
In reply to: [Media Library Assistant] Showing uploaded photos on user profileI have problem with this. When set this up and tested I had only two users and it worked with them. Now i added more users and for them it does not work. Shortcode displays all photos regardless of user. Like there is no user filter.
Strangely, for the first two users it works normally – shows only photos authored by that users.
I checked everything I could think off. All users are set in the same way. The only difference is that those two first users where short code works are administrators, others are subscribers. But I tested, it changed one of the users to Administrator, and it did not change a thing. His profile still shows all photos, not only his.
What could I look for?Forum: Developing with WordPress
In reply to: How to use the_post to change post_title?That is what docs say: the_post is called right after query is executed containing post that is result of query.
I wanted to change that post before it is displayed, but changes are not visible on web page.
Forum: Developing with WordPress
In reply to: How to use the_post to change post_title?Yes, I was looking for that filter and I found various title filters but that one. ?? Keyword is to generic.
the_title filter did exactly I wanted. Thanks.
But question still stays, why changing post in action the_post does not affects displaying post?
I tried to change slug to something different just in case slug is reserved keyword, but it makes no difference.
Whatever I set for archive slug for this custom type, i get the same: slashes are removed from query and then query does not match.
i tried to change regexp to
$rule = '^sites/theme/([^/]+)/?$';
That should make it more distinguishable from other URLs.
But again, query is messed up ( all / characters are removed).
Again, when I try this using page instead of archive, it works.Thanks. I tried that but with no difference.
There is an issue with permalinks (category_name) is handled properly once url rewrite is matched, which I cannot get to.
I actually did this first using page, and same settings jsut redirecting to page work fine. But I believe it is better to use archive for this so I am trying to make url rewriting handle this through archive.
I installed QueryMonitor plugin so I can now se url_rewrite matching for a url.
For:$rule = '^sites/([^/]+)/?$'; $rewrite = 'index.php/?post_type=sajt&category_name=$matches[1]'; add_rewrite_rule($rule,$rewrite,'top');
i get this:
It seems request is for some reason messed up. If I turn of rewrite rule action, then request is ok but it is recognized as attachment.
It has to be something with archive handling, as, when I do the same thing but use page instead of archive, with same slug, and redirect to index.php?pagename=sajtovi&category_name=$matches[1] it works.
Forum: Developing with WordPress
In reply to: Cannot apply category from URL to QueryLoop BlockI first tried using $query->set() but in query_loop_block_query_vars it is not available.
It worked in pre_get_posts.
It would be helpful, that QueryLoop block has options for user to set values for specific properties by using existing global variables or from template.
For example, option not just to select categories to filter by category, but to set it filter by global_var category_name, or so.QueryLoop is generally lacking of options to dynamically use some data from the system. All settings must be entered manually and stay fixed.
Yes, I am talking about usage when QueryLoop is set not to inherit from the template which is used whenever something needs to be customized. User has just two options: either to completely relay on collecting all from template or having to set all manually and fixed. There should be option to mix two of them: some QueryLoop properties needs to be collected from template, and some needs to be set fixed, or even override values from template.
Forum: Developing with WordPress
In reply to: Cannot apply category from URL to QueryLoop BlockSolved it by manually setting filter in pre_get_posts.
add_action( 'pre_get_posts', 'un_test_posts_query' ); function un_test_posts_query( $query ) { global $wp; if ($query->query['post_type'] == 'site') { $query->set ('category_name', $wp->query_vars['category_name']); } return $query; }
I still not understand why query does not gather this automatically.
- This reply was modified 1 year, 8 months ago by pedjas.