Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

fsif posted:

Nah, I never used @wordpress/create-block; not certain it was around when we first started making blocks. Most of my working knowledge came from this series: https://css-tricks.com/learning-gutenberg-1-series-intro/

We have a build script using the Wordpress babel plugin and then add a bunch of nonsense into our functions.php. Probably not worth it, honestly. Unless you have a lot of really special business logic or want to build out a bunch of advanced functionality (like make querying an API for options or something), I really recommend just using ACF blocks.

If you (or anyone else) want more info about the former you can send me a PM and I can try to give more specifics, but again, it's IMO a huge hassle and not worth the payout for most use cases.

You're right, after a few hours of digging I discovered that it's more trouble than it's worth. I wanted to make a simple copy of the "Media and Text" block where I could use my own CSS classes and not have the Wordpress classes, just to keep my HTML and CSS as clean as possible. It was a mess. I'm surprised there isn't a tool to generate the code. There are things like Lazy Blocks, but it can only export the block code in a format that a site with Lazy Blocks installed can read. The WP team seems to be making big improvements to the CMS, so the Gutenberg dev experience is probably low on the list of priorities right now.

Adbot
ADBOT LOVES YOU

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
A lot of people swear by this plugin

https://wordpress.org/plugins/simple-css/#description

I don’t know if it actually does anything special, but generate press is an awesome theme that isn’t a _s type imho. I’ll probably try it out since I write a lot of css that’s reusable.

counterfeitsaint
Feb 26, 2010

I'm a girl, and you're
gnomes, and it's like
what? Yikes.
I've been asked to update this Wordpress site. The problem I'm having is any kind of custom jquery animation bugs out and is really jerky. It pauses after a fraction of a second, sits there not animating, and then jumps to the completed animation. It's on a theme called H-Code, which uses WPBakery for it's page builder. I've searched for the problem with both the theme and page builder without luck. I've tried it on iOS, windows, Firefox and Chrome and they behave the same. I've tried adjusting the css and I can change the easing and length of the "animation" but that doesn't make it animate properly. My best guess is it has something to do with the version of jquery the theme is using, which is a little beyond me. Either that or something in the css that I'm completely missing. I have tried enqueuing the necessary jquery ui scripts to make sure they're actually loading but that didn't help.

You can see an example here: https://ventureupward.org/development/ click "How it Works" in the hero image at the top. There's a few other places where there's custom jquery to animate things on the site, and they all have the same problem, but that's probably the easiest example.

Any feedback or ideas as to what's causing it would be greatly appreciated.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

counterfeitsaint posted:

I've been asked to update this Wordpress site. The problem I'm having is any kind of custom jquery animation bugs out and is really jerky. It pauses after a fraction of a second, sits there not animating, and then jumps to the completed animation. It's on a theme called H-Code, which uses WPBakery for it's page builder. I've searched for the problem with both the theme and page builder without luck. I've tried it on iOS, windows, Firefox and Chrome and they behave the same. I've tried adjusting the css and I can change the easing and length of the "animation" but that doesn't make it animate properly. My best guess is it has something to do with the version of jquery the theme is using, which is a little beyond me. Either that or something in the css that I'm completely missing. I have tried enqueuing the necessary jquery ui scripts to make sure they're actually loading but that didn't help.

You can see an example here: https://ventureupward.org/development/ click "How it Works" in the hero image at the top. There's a few other places where there's custom jquery to animate things on the site, and they all have the same problem, but that's probably the easiest example.

Any feedback or ideas as to what's causing it would be greatly appreciated.

Have you thought about just cutting jQuery out of the equation altogether and using CSS animations?

I clicked "Frequently Asked Questions" in the hero section and I can see a bunch of CSS properties changing values all rapid-fire, probably too fast for browsers to keep up with. Changing from display: none to display: block is usually janky to begin with, and then the animation is changing height plus various separate padding and margin properties on multiple things at the same time... it's all really overkill for what you're looking to do.

code:
#animated-faq {
  background: #fff;
  display: block;
  max-height: 0px;
  overflow: hidden;
  padding: 0rem;
  transition: all 0.5s ease-in;
}

#animated-faq.animated {
  padding: 2rem;
  max-height: 5000px; /* Way bigger than it'll ever be, but good for animating. */
}
I haven't targeted IDs with CSS in a while, writing it looks weird now. I haven't written jQuery in years either, but this should work if you don't want to switch to vanilla JS:

code:
$( "#faq-button" ).click(function() {
  $("#animated-faq").toggleClass("animated");
});

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Any of you know if its possible to "dynamically" create coupon codes for WOoCommerce? i.E. you have a list of people and you want to create a coupon code per person, if that makes sense?

I was having issues trying to word it correctly to search for it

the heat goes wrong
Dec 31, 2005
I´m watching you...

Empress Brosephine posted:

Any of you know if its possible to "dynamically" create coupon codes for WOoCommerce? i.E. you have a list of people and you want to create a coupon code per person, if that makes sense?

I was having issues trying to word it correctly to search for it

Do these people already have accounts on the site? Having an email or already existing user makes it easier.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
No, it'd be from a external database unfortunately.

the heat goes wrong
Dec 31, 2005
I´m watching you...
Generate a bunch of unique coupon codes?

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
I could do that and just randomly assign them, was just hoping there was a way to auto generate them on like new user registratiin

kedo
Nov 27, 2007

Empress Brosephine posted:

I could do that and just randomly assign them, was just hoping there was a way to auto generate them on like new user registratiin

I googled basically the last part of your sentence and found this: https://www.webtoffee.com/auto-generated-woocommerce-signup-coupon/

E: I’d also be surprised if Woocommerce doesn’t provide you with the ability to generate coupons in PHP, so you could probably handle this with a simple hook into WP’s account creation process.

kedo fucked around with this message at 23:34 on Apr 18, 2021

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Ooo sweet I'll look into this, thanks

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Took on a project to update a WordPress site that uses 61 plugins to do something simple. UGH.

kedo
Nov 27, 2007

Oof, no ty.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Yeah. It's mostly just a combination of Gravity forms & Gravity Views to do custom pages.

I got it down to 20...I could get it down to 5 but i'd have to reprogram their custom page system but :effort:

Thorbeef
Jul 24, 2007

Empress Brosephine posted:

Took on a project to update a WordPress site that uses 61 plugins to do something simple. UGH.

Funny you mention that just now, I have just taken on a WP site that had 80+ plugins. Most of the plugins only work on PHP 5.6 and broke spectacularly after moving to 7.3.

I think I woulda spent less time rebuilding the site.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

supermegaultra posted:

Funny you mention that just now, I have just taken on a WP site that had 80+ plugins. Most of the plugins only work on PHP 5.6 and broke spectacularly after moving to 7.3.

I think I woulda spent less time rebuilding the site.

That's what I tell people when their site is that overloaded. Time to rebuild, or I can't help.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
That's what I did; rebuilt the site basically, only taking in the custom logic that was essential, or just moving everything to a PHP shortcode that I made. Its sooo much faster now.



Currently, they use Gravity Forms and Gravity Views to allow users to make edits to their profile with some custom fields. But I feel like this could be better served with ACF.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Do any of you use ACF Pro and have used the Gallery field? Does it allow you to drag and drop and re-order images?

https://www.advancedcustomfields.com/resources/gallery/


This whole system the pass developers made of using GravityForms & GravityViews to make user profiles instead of just using custom fields is a nightmare.

kedo
Nov 27, 2007

I haven't used it personally, but I tend to keep a WordPress instance running in my local dev environment and on a dev server so I can test things like this out, might be worth looking into. With MAMP, getting WP running locally is pretty quick and easy.

Also, Gutenberg has a Gallery block.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Ill check into that thank you.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS

kedo posted:

I haven't used it personally, but I tend to keep a WordPress instance running in my local dev environment and on a dev server so I can test things like this out, might be worth looking into. With MAMP, getting WP running locally is pretty quick and easy.

Also, Gutenberg has a Gallery block.

ACF Pro had exactly what I needed almost to a scary level. So now I get to redevelop a member section, yay :suicide:

squirrelzipper
Nov 2, 2011

Hey WP goons, I have a question I'm wondering if someone can point me in the right direction on. I'm helping a friend with their site, and he's not super technical. My background is more so but not WP (I don't know PHP) and am more familiar with css.

Anyway, the site has custom post types using CPTUI Ext. and that's pretty straightforward. We're using shortcodes to pull these into other post/pages. Where I'm struggling is on how to style these. For example CPTUI has a default shortcode that lists the custom posts with the feature image, Title, then an excerpt. Cool.

Example: [cptui cptui_posttype="partner" cptui_shortcode="default_shortcode" cptui_shortcode_id="2105" title="Payment+Partners" featured_image="on" taxonomy-application="payments"][/cptui]

Now in the CPTUI docs it talks about how you can style this as the shortcode creates a div that can be styled by class. This is where I'm struggling. That's all it says. So is the div class "default_shortcode" cause that doesn't seem to work. I'm a bit ignorant on shortcodes and the interaction with css.

thanks!

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
If you right click on what the shortcode shows on the page and go to inspect your browser should show you the class that you can style. If you need more help feel free to email me the link and I can get it for you tomisthebest@gmail.com

squirrelzipper
Nov 2, 2011

Empress Brosephine posted:

If you right click on what the shortcode shows on the page and go to inspect your browser should show you the class that you can style. If you need more help feel free to email me the link and I can get it for you tomisthebest@gmail.com

Thanks for some reason it didn’t occur to me to just inspect the element lol, I’ll try that.

e; yup that was pretty straightforward. but, but, why don't the plugin authors just document that? these aren't custom shortcodes, it's their build in ones so, argh. Anyway, thanks that did the trick.

squirrelzipper fucked around with this message at 02:10 on May 14, 2021

wearing a lampshade
Mar 6, 2013

Because wordpress is hell

kedo
Nov 27, 2007

CSS classes are CSS 101. I'd imagine the assumption is that if you're capable of styling an element using CSS, you're going to know what a class is and how to find it. I've hardly ever seen class names specified in documentation, inside or outside of WordPress, usually because there are dozens or hundreds of them on a page, they get added/removed dynamically by JS, etc.

The tricky thing about WP in general is that it caters to a non-developer crowd, but if you want to do any customization outside of what a theme/plugin allows with their GUI, you're in developer-land and the amount of required knowledge to do so goes through the roof.

squirrelzipper
Nov 2, 2011

kedo posted:

CSS classes are CSS 101. I'd imagine the assumption is that if you're capable of styling an element using CSS, you're going to know what a class is and how to find it. I've hardly ever seen class names specified in documentation, inside or outside of WordPress, usually because there are dozens or hundreds of them on a page, they get added/removed dynamically by JS, etc.

The tricky thing about WP in general is that it caters to a non-developer crowd, but if you want to do any customization outside of what a theme/plugin allows with their GUI, you're in developer-land and the amount of required knowledge to do so goes through the roof.

Yeah thanks I’m very familiar with css, just didn’t occur to root around from that angle because I’m used to working with either user defined classes or, gasp, documented ones. If you want to customize say Bootstrap, the classes are pretty well documented at all levels. So when a plug-in in says “hey we have these standard things and they make a class but no we’re not going to tell you what it is (but it’s not dynamic! It’s the same every time!)” I think that’s dumb.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Nah get used to going to the inspector with wordpress. Nothing is standard, nothing is ever well documented etc.

frogbs
May 5, 2004
Well well well
I have a customer that wants to setup a quiz with 5 or 6 questions , that ends with a recommendation for a product based on the answers the user chooses. I feel like I could probably setup something like this with gravity forms or ninja forms, but it'd probably end up feeling like a hack. Can anyone recommend a good quiz plugin that would work for something like this?

So far this is the best candidate i've found: https://cmoreira.net/advisor-quiz/

timp
Sep 19, 2007

Everything is in my control
Lipstick Apathy

frogbs posted:

I have a customer that wants to setup a quiz with 5 or 6 questions , that ends with a recommendation for a product based on the answers the user chooses. I feel like I could probably setup something like this with gravity forms or ninja forms, but it'd probably end up feeling like a hack. Can anyone recommend a good quiz plugin that would work for something like this?

So far this is the best candidate i've found: https://cmoreira.net/advisor-quiz/

Quick lazy answer: Google Forms can do quizzes so you could just iframe something and call it a day :effort:

kedo
Nov 27, 2007

Check out Gravity Forms addons section on their site, I’m 99% sure they have a quiz addon.

wearing a lampshade
Mar 6, 2013

kedo posted:

Check out Gravity Forms addons section on their site, I’m 99% sure they have a quiz addon.

they do, but if you need to display results i'd stay away from it. {all_fields} outputs as a table and its disgusting trying to rewrite the output filter

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
You could do it with acf but you'd have to write the code if you're comfortable with that and query wordpress DB

frogbs
May 5, 2004
Well well well

Empress Brosephine posted:

You could do it with acf but you'd have to write the code if you're comfortable with that and query wordpress DB

That’s a good point! Unfortunately these guys aren’t paying that much and I can tell they’re not going to be able to make up their minds on what questions they want. I’d probably have to redo it like 5 times for them. I think I’m gonna stick with one of the plug-in options I’ve found unless they’re truly terrible.

fuf
Sep 12, 2004

haha
Anyone have any opinions on CDN providers or have one they use regularly with WP sites?

It looks like https://quic.cloud/ has some WP specific stuff?

RadiRoot
Feb 3, 2007

fuf posted:

Anyone have any opinions on CDN providers or have one they use regularly with WP sites?

It looks like https://quic.cloud/ has some WP specific stuff?

WPEngine has been a host that I've used regularly that also includes cdn support through Maxcdn. I've been pretty happy with them and their support is good too.

https://wpengine.com/support/how-does-a-cdn-work/#WP_Engines_CDN

squirrelzipper
Nov 2, 2011

Radirot posted:

WPEngine has been a host that I've used regularly that also includes cdn support through Maxcdn. I've been pretty happy with them and their support is good too.

https://wpengine.com/support/how-does-a-cdn-work/#WP_Engines_CDN

The project I’m working on - and I’m not a WP expert at all - is hosted at WPEngine and I’m pretty impressed with them. They have a sensible dev>staging>prod path, good sftp setup and redirect management, and yeah good support from the one time I had to use it.

wearing a lampshade
Mar 6, 2013

gonna get into gutenberg starting next week, and we're gonna be using acf i believe for db stuff. I really really hate that that stuff's not version controlled, it bothers me that acf doesn't scrub the database once a field/group is deleted and i can't convince them to use theme code pro which at least saves field settings as json locally, so I want to look at doing it from scratch and maybe building something to make it a bit easier and more appealing for the other devs on my team. i took a look at wpbrick and it seems pretty solid, though the codebase has a tooon of settings and configs thats probably only useful to a non-developer, is there a good starter example of a basic custom gutenberg block theme/plugin thats only geared towards devs? I really don't care about offering the client/user the ability to control block padding by pixel.

kedo
Nov 27, 2007

If you're already using ACF: https://www.advancedcustomfields.com/resources/blocks/

Also, you can use ACF to generate PHP code for your fields and either include it in your theme or save it as a plugin which allows it to be version controlled.

Adbot
ADBOT LOVES YOU

wearing a lampshade
Mar 6, 2013

but thats a manual process right?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply