Kyrian
Forum Replies Created
-
Oh right, I didn’t realize that your forms are also displayed via shortcode. So I can just add my own short odes on the same page. Cool!
Yes,
I’d like to add a “Login with Patreon” button via shortcode (the plugin I use is called “Patron PRO”)Forum: Plugins
In reply to: [LiteSpeed Cache] How to exclude a certain page elemtn from cache?Thanks for the heads up !
Forum: Plugins
In reply to: [Comments - wpDiscuz] FontAwesome icons not being showedThank you, I have several plugins all calling Fontawesome, but I am also calling it with a PHP snippet.
They must be conflicting with each other someway, will have to dig deeper…
Thanks for the explanation! I don’t want to mess up with the code, but I was curious to know why it was there.
Forum: Plugins
In reply to: [Mailster Mailgun Integration] “API key wrong ” errorThanks, I read the other support request and I thought there was no one following up here.
I uninstalled and reinstalled but I always get the error, if using a “EU” domain the API does not recognize it and only shows the sandbox domain. If using a US domain it works fine.
I’ll just use a US domain, no biggie.Forum: Plugins
In reply to: [Mailster AmazonSES Integration] Fatal error when inserting Amazon keysThanks for the quick reply!
Amazon just denied my request to use their service, so I will not use the plugin unfortunately.Forum: Plugins
In reply to: [LiteSpeed Cache] Refused to execute script – Failed to load resourceReport number:?JCRGAHNE
please note I do not have the issue described in this ticket anymore, thanksForum: Plugins
In reply to: [Mailster AmazonSES Integration] Fatal error when inserting Amazon keysI am on PHP 8.1 – not sure if it’s relevant
Forum: Plugins
In reply to: [LiteSpeed Cache] Refused to execute script – Failed to load resourceI usually use the “Purge ALL” link, just to be sure.
Then I also purge Cloudfare, Object Cache (maybe these are already included in Purge ALL, not sure), and finally I purge my browser cache.
But this time it did not seem to do the trick.Forum: Plugins
In reply to: [LiteSpeed Cache] Refused to execute script – Failed to load resourceThanks. Yes I did purge all the caches a number of times, but the error persisted for some hours. Odd.
Forum: Plugins
In reply to: [WP User Merger] User roles do not get preseved/mergedSuper, thanks!
Forum: Plugins
In reply to: [Favorites] Pagination for the favorites list?I tried the code you suggested but was throwing an error.
This is a version corrected by ChatGPT that works for me. I ahve not tested the pagination yet, but it outputs my favorites correctly.
You have to change this line
‘post_type’ => [ ‘meditazione’ ], // Post type being displayed.
according to the post type you want to show the favorites for<?php $favorites = get_user_favorites(); ?> <div class="container"> <?php if ( empty ( $favorites ) ) : ?> <!-- No Favorites Found --> <h3 id="no-favs-yet">No Favorites Yet</h3> <p>Click on a heart to save a wedding as one of your favorites.<br>Reload the page to see your updated favorites.</p> <?php else : ?> <?php // Retrieve current pagination link $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $favorites_query = new WP_Query( [ 'post_type' => [ 'meditazione' ], // Post type being displayed. 'posts_per_page' => 3, // Control how many favorites on each page we want. 'ignore_sticky_posts' => true, 'post__in' => $favorites, 'paged' => $paged // If you want to include pagination, and have a specific posts_per_page set ] ); // Loop over favorite posts while ( $favorites_query->have_posts() ) : $favorites_query->the_post(); // Markup for each favorite below. ?> <div class="grid-post_outer masonry-item masonry-brick"> <div class="postformat-standard"> <a class="blog-thumb" href="<?php the_permalink(); ?>"> <h3><?php the_title(); the_favorites_button(); ?></h3> </a> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(); ?> </a> </div> </div> <?php endwhile; ?> <?php // Link to goto next page of favorites. next_posts_link( 'Older Favorites', $favorites_query->max_num_pages ); // Link to goto previous page. previous_posts_link( 'Newer Favorites' ); ?> <?php endif; ?> <?php wp_reset_postdata(); ?> </div>
To place this code in a page, you probably need something like the “Code Snippets” plugin. You create a PHP snippet with the code and then place the shortcode in the page. Should work.
Forum: Plugins
In reply to: [Favorites] Pagination for the favorites list?You may try to ask for help to ChatGPT. I have been able to code many things thanks to that tool.
For instance, this is how ChatGPT explains the code you just linkedThis is a PHP code that displays a list of user’s favorite posts of a custom post type called “my-post-type”. The code has two main parts:
- The first part gets the user’s favorite posts using the function “get_user_favorites()” which is not shown in this code. It then checks if the user has any favorite posts or not using the “empty()” function. If the user has no favorite posts, it displays a message to inform the user how to add posts to their favorites. If the user has favorite posts, it proceeds to the second part.
- The second part retrieves the user’s favorite posts and displays them in a grid using the “WP_Query” function. It sets the post type to “my-post-type”, the number of posts to display per page to 10, and ignores sticky posts. It then loops over the favorite posts and outputs the markup for each post, which includes the post’s title, permalink, and thumbnail. Finally, it includes links to the next and previous pages of the user’s favorite posts using the “next_posts_link()” and “previous_posts_link()” functions.
At the end of the code, it resets the post data using the “wp_reset_postdata()” function to ensure that any subsequent WordPress functions will use the correct data. The HTML markup is embedded within PHP tags to dynamically generate the content of the page based on the user’s favorites.
ChatGPTThere is also another great AI tool to code specifically for WordPress: https://codewp.ai/. This one is not free, but they give you some free credits when you sign up.
Have fun!- This reply was modified 2 years ago by Kyrian.
Forum: Plugins
In reply to: [Favorites] Pagination for the favorites list?I don’t. For now, I have put the favorites shortcode inside a div with fixed height and overflow scroll
.favorites-list__wrapper { max-height: 500px; overflow: scroll; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; padding-left: 20px; padding-right: 20px; width: 100%; }
the list can still become huge of course, but at least the user only sees a small window. You can also put the wrapper inside an accordion.
This is what I did, each accordion has favorites for adifferent section of the site.
see https://tinyurl.com/2hsljbfjhope this helps!
- This reply was modified 2 years ago by Kyrian.