bluedogranch
Forum Replies Created
-
Thanks, wp_insert_post_data looks like what I should use. The notes say that it also runs on post update; I wonder if there’s way to only have it run once?
And “The modified times will appear after the editor page reloads.” But the page doesn’t reload in a traditional sense, as the Block editor uses Ajax, and also a popup for the date and time scheduler.
Forum: Developing with WordPress
In reply to: Using jQuery with the Block editor?Hi @dilip2615 Thanks for the answer; that’s interesting the way jQuery can interact using
wp.data
, and it works.And yes, plain Javascript is probably the better way to go. But now I’m thinking that I should try PHP and an action hook to set the time on a new post to 8am, as I find issues with using cookies and detecting when
post-new.php
is in the URL with jQuery.Hi @threadi, thanks, and yes, I think I need to learn more Javascript and learn more how the Block Editor works.
Ok thanks! That worked.
Forum: Fixing WordPress
In reply to: Commenting on underscores home page redirects to single postI’m trying a new, barebones underscores theme I downloaded using the underscores page and comparing the differences, but no luck yet.
So, in the big picture, do you think this functionally possible or impossible in WordPress?:
- Home page shows latest posts (say 10 as an example) and uses
index.php
instead ofarchives.php
. - Threaded comments are enabled (User must be logged in, if it matters).
- Under each post on Home, all existing comments and a comment reply box are shown.
- When a user adds a new comment to any of the posts or replies to any threaded comment, they are not redirected to the single post to comment on that post but they remain on the Home page to write a comment and submit. The Home page will refresh after submit, but that’s not an issue.
Bonus: if the above is possible (remaining on the Home page to write a comment and submit), is it then possible to add Ajax functionality for comment submissions?
Forum: Fixing WordPress
In reply to: Commenting on underscores home page redirects to single postThanks, that gives me some new places to look. I’ll check for differences with the WP core
comments_template
file. What theme are you using for your own testing?Forum: Fixing WordPress
In reply to: Commenting on underscores home page redirects to single postThanks, I want to use threaded comments, and do get them from the discussion setting. And adding a non-threaded, new comment on a post on Home/Posts works fine. The problem is that the “Reply” link on earlier comments points to the single post, so users can only add reply to a threaded comment on the single post. See screenshot. https://ibb.co/VVGFGWw
Is there a way to to hook into the comment code to change the Reply link from the single post to Home/Posts or something to keep people on the Home/Posts page when they reply to a threaded comment?
I don’t have a
if ( ! is_single()) return; //without doing anything
in this theme’scomments.php
Forum: Fixing WordPress
In reply to: Commenting on underscores home page redirects to single postThanks! That’s interesting. Yes, the home page is the default blog archive page. I looked around for
comment_post_redirect
and found thisadd_filter('comment_post_redirect', 'redirect_after_comment');
function redirect_after_comment($location)
{
return $_SERVER["HTTP_REFERER"];
}to “keep” users on the home/posts page when they comment, and that works. Single post commenters and viewers stay on single posts, too.
But, hah, now I see a new issue: threaded comments. With non-threaded comments selected, the above redirect works on Home/Posts page. But with threaded comments selected, the “Reply” link in each comment still points to the single post URL. Is it possible to hook into that and change the URL and somehow get threaded comments to work?
Forum: Plugins
In reply to: [WooCommerce Square] Switching between two Square accounts?Hi,
Thanks for the response, but I see you offering code in other threads for other issues. You can’t tell me what hook to try?
I tried WooCommerce Community Slack a few weeks ago and got no answer.
And I’m using Square, not PayPal or Stripe, so there’s no reason for me to add different payment gateway and use the Conditional Payments plugin.
- This reply was modified 9 months, 4 weeks ago by bluedogranch.
Thanks! I ended up using the more specific ACF hook:
function my_acf_admin_head() { ?> <style> .acf-row.-collapsed .acf-label { display: none; } <style> <?php } add_action('acf/input/admin_head', 'my_acf_admin_head');
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Add search dropdowns for meta_key(s)?Thanks for the ideas! I deactivated Relevanssi and there was no change in the search results, so it appears that PMPro uses their own search. And yes, I need to figure out how to filter on
meta_values
inwp_usermeta
. PMPro had a sample filter widget that I need to hack and add dropdowns. So I got some things figured out; thanks for your ideas.Forum: Themes and Templates
In reply to: [GeneratePress] How do I call a custom sidebar?Thanks! That’s a good generic way to make it work, and safe using “if is active.”
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Category/tag filters on search results page?That was it. I manually changed the
post_types=
toany
query in the URL and got the correct filtered results. Then I found that the query was wrong in the Search & Filter shortcode itself; someone had usedall
instead ofany
.Thanks for your help!
Forum: Plugins
In reply to: [Relevanssi - A Better Search] Category/tag filters on search results page?Hi Mikko,
Thanks for your help! This is a curious issue. When I filter, as in the screenshot linked above, I get no results, but also I found that if I enter a new search term in the search box, or in the menu bar search, I also get no results. So something is maybe breaking the search input.
The browser URL can be, after filtering, i.e, example.com/category/articles/?s=leaders&post_types=all Is that a valid search URL?
I also came across this that says the Pro version of Search & Filter works with Relevanssi https://searchandfilter.com/documentation/3rd-party/relevanssi/ But I don’t have the Pro version, and I don’t know if you tested with the Pro or free version.
I can’t post the site URL as it is a staging site. Relevanssi debug and WordPress debug show no related errors.
Any ideas?
Cheers
Thanks! I would like to use Relevanssi for both searches; I’ve been using Relevanssi for at least four years on other sites. But the current results appearance is highly customized, so I’ll need to adapt that. Your tip to use
get_template_part()
is a good idea. Thanks!Never mind, I found it ??
- Home page shows latest posts (say 10 as an example) and uses