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
DAD LOST MY IPOD
Feb 3, 2012

Fats Dominar is on the case


Having a bizarre problem.

I have kind of a long article going up on Wordpress and I'd like to add some nice little anchor tags in there for SEO purposes. The first one I added works fine: <a id="anchorname"></a>, it works, and when I'm in Visual mode I can see the little anchor symbol.

Every subsequent anchor tag simply disappears and becomes nbsp the second I hit update. I have tweaked them, tried everything I can think of. Doesn't matter. When I add more anchor tags they vanish into nbsp-land. The formatting is identical to the first tag, which continues to function properly.

Any idea what might cause this?

Adbot
ADBOT LOVES YOU

kedo
Nov 27, 2007

WordPress automatically strips lots of HTML from posts once they're updated/published. You can tell it not to strip things by adding some code to your functions.php. I believe in your case, WP is likely seeing the anchor as empty and therefore extraneous.

Also, you can add the id to anything you want, it doesn't have to be an anchor to work as a target for a link.

Misc
Sep 19, 2008

DAD LOST MY IPOD posted:

Having a bizarre problem.

Any idea what might cause this?

try disabling plugins / switching themes then try again. if you have root access to the server, check modsecurity / OWASP for false positives if you use that

DAD LOST MY IPOD
Feb 3, 2012

Fats Dominar is on the case


I ended up solving it by using a plugin to create anchors, which I guess works. Still didn’t find out what caused it.

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
I'm evaluation options for offering subscriptions on my site and wanted things to be more nicely integrated than popping up an external link to PayPal.
I came across this:
https://wpspring.com/products/woocommerce-subscriptions-plugin/

I realize that I'd be manually installing updates and it would be different support than the licensed version through the WooCommerce site, but is this legal?
It says GPL version.

Misc
Sep 19, 2008

Uziel posted:

I'm evaluation options for offering subscriptions on my site and wanted things to be more nicely integrated than popping up an external link to PayPal.
I came across this:
https://wpspring.com/products/woocommerce-subscriptions-plugin/

I realize that I'd be manually installing updates and it would be different support than the licensed version through the WooCommerce site, but is this legal?
It says GPL version.

this should help you understand what's happening here. act on whatever your personal ethics are, but if you're gonna get software from an unofficial source I don't know why you'd still pay for it

https://wpmayor.com/wordpress-gpl-abuse/

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
Thanks, I had no idea!

raej
Sep 25, 2003

"Being drunk is the worst feeling of all. Except for all those other feelings."
Some upgrade to my site killed off bones_main_nav() somehow. I'm using Divi. It seems there is a Boiler2 Theme Found Here that defines the bones_main_nav(). How would I get this working in my current site? Is there a way to integrate Boiler2 functions into Divi, or can I make it a child theme somehow?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

raej posted:

Some upgrade to my site killed off bones_main_nav() somehow. I'm using Divi. It seems there is a Boiler2 Theme Found Here that defines the bones_main_nav(). How would I get this working in my current site? Is there a way to integrate Boiler2 functions into Divi, or can I make it a child theme somehow?

I read your stuff in the php thread, it's kind of a screwed if you do screwed if you don't situation. Sure, copy out functions, but now they're never going to be updated. This is kind of the problem with WP in general, with so many interacting parts, if one of them slips out of cycle you're kind of in a tough spot. I had a similar problem with a past client who refused to update their paid theme (Flatsome) to 3.0, which meant that WooCommerce updates outpaced it, and then a bunch of WP deprecates started messing with those in turn. I got it working, but then fired the client before having to deal with their crap further.

raej
Sep 25, 2003

"Being drunk is the worst feeling of all. Except for all those other feelings."

Scaramouche posted:

I read your stuff in the php thread, it's kind of a screwed if you do screwed if you don't situation. Sure, copy out functions, but now they're never going to be updated. This is kind of the problem with WP in general, with so many interacting parts, if one of them slips out of cycle you're kind of in a tough spot. I had a similar problem with a past client who refused to update their paid theme (Flatsome) to 3.0, which meant that WooCommerce updates outpaced it, and then a bunch of WP deprecates started messing with those in turn. I got it working, but then fired the client before having to deal with their crap further.

It's honestly not going to need updating much. It's for a bar, and this page shows what beers we have on tap at any given moment. I was forced to update after porn sites starting injecting into links. I plan on turning updates off and locking down WP a lot more, but everyone is whining about not seeing the online taplist.

Hughlander
May 11, 2005

I'm helping a friend out with their WP site, but while I've used PHP in the past I'm much more of a Java/C#/C++ full stack developer, so I feel like I'm just having a million XY problem questions.

I'm looking to filter the main page of a site into a three column layout with the first two columns being all posts by one tag then another. IE: Show last 10 posts for "topicA" in first column, Last 10 for "topicB" in 2nd column, and custom login/ads etc in 3rd.

Is this a theme I am looking for or a plugin/filter with some custom coding? Is there an easy search term that I just don't know the name of for it?

the heat goes wrong
Dec 31, 2005
I´m watching you...
You want a page template.

Specifically page template that is meant for the front page.
1. Create file called front-page.php and drop it into the theme folder. WordPress will use it every time when you go to the front page.
2. Copy/paste content from index.php into it.
3. Start modifying the template. First column query posts based on tag A, second column post based on tag B, and login/ads into the third one.

Fluue
Jan 2, 2008
I'm working on refactoring a custom shortcode plugin for a marketing site that renders a form with any number of fields of many types (fields to display specified as a shortcode attribute). The first iteration of the plugin was developed OOP-style, and is part of a larger plugin, but it's getting difficult to modify as requirements change.

I'm thinking of using the Builder pattern to separate concerns and turn fields into "Parts" that are dynamically added via the shortcode attributes and then the call to render the shortcode in a page/post would call the builder's
pre:
$shortCodeFormBuilder->render()
method.

Is this doable in Wordpress without a lot of mucking around in getting the pattern to work properly?

smiling giraffe
Nov 12, 2015
The natural history society in my local area has a Wordpress website, that includes a plugin to submit data on animal sightings using a form. As part of a personal project, I plan to create a Android app that will also allow users to submit data on animal sightings. In order to do this, I've written a Wordpress plugin that extends the REST api to allow POST requests on the table that records the sightings.

So my question is, what if any, security measures are appropriate for my REST api? Anyone will be able to use the app, but it seems like a good idea to restrict the use of the api to my app. I was looking at something like this: https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/, but I'm wondering if its overkill for a project that will in all likelyhood only be used by tens of people.

huhu
Feb 24, 2006

smiling giraffe posted:

The natural history society in my local area has a Wordpress website, that includes a plugin to submit data on animal sightings using a form. As part of a personal project, I plan to create a Android app that will also allow users to submit data on animal sightings. In order to do this, I've written a Wordpress plugin that extends the REST api to allow POST requests on the table that records the sightings.

So my question is, what if any, security measures are appropriate for my REST api? Anyone will be able to use the app, but it seems like a good idea to restrict the use of the api to my app. I was looking at something like this: https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/, but I'm wondering if its overkill for a project that will in all likelyhood only be used by tens of people.

🤔 That seems like overkill. Is there authentication on the site you're sending content to? I'd probably just rate limit requests.

smiling giraffe
Nov 12, 2015

huhu posted:

🤔 That seems like overkill. Is there authentication on the site you're sending content to? I'd probably just rate limit requests.

Sounds like a plan. Thanks much.

Xarthor
Nov 11, 2003

Need Ink or Toner for
Your Printer?

Check out my
Thread in SA-Mart!



Lipstick Apathy
Hey friends, one quick question:

My site is showing up as "not secure" which I understand has something to do with the certificate settings. How do I modify/change those?

For reference my site is http://djspiraldive.com - I'm using WP 4.9.8 with the Boldgrid App. The theme is called "HiFidel"

mewse
May 2, 2006

Xarthor posted:

Hey friends, one quick question:

My site is showing up as "not secure" which I understand has something to do with the certificate settings. How do I modify/change those?

For reference my site is http://djspiraldive.com - I'm using WP 4.9.8 with the Boldgrid App. The theme is called "HiFidel"

Changing the http to https in your url shows that your webserver is providing an invalid certificate. It looks like a self signed certificate with the hostname "djspiraldive.exhibit3.com".

It looks like you might be using a wordpress hosting package from inmotion hosting -- they should provide you instructions on how to set up a SSL certificate for your site and domain name. You will probably want to get certificates from LetsEncrypt because they are free and easy.

Not much of this has to do with wordpress, it's more of a web server problem.

Xarthor
Nov 11, 2003

Need Ink or Toner for
Your Printer?

Check out my
Thread in SA-Mart!



Lipstick Apathy

mewse posted:

Changing the http to https in your url shows that your webserver is providing an invalid certificate. It looks like a self signed certificate with the hostname "djspiraldive.exhibit3.com".

It looks like you might be using a wordpress hosting package from inmotion hosting -- they should provide you instructions on how to set up a SSL certificate for your site and domain name. You will probably want to get certificates from LetsEncrypt because they are free and easy.

Not much of this has to do with wordpress, it's more of a web server problem.


Ah okay. Cool. My buddy runs the server (exhibit3) so I'll talk to him about the SSL. Thanks for the quick help.

The XKCD Larper
Mar 1, 2009

by Lowtax
I'm setting up a wordpress for a theatre. There are custom post types for Plays and Events (classes, receptions). I need to have an events calendar, which would read from timetable fields attached to the custom post type for Plays and Events.

So far I can't tell if any calendar plugins have the capability to read from more than one post type, or easily query the timetables and build a calendar from that. Are there any plugins that can do this, or without a lot of effort?

As an alternate option I've thought that it might be possible to add a hook to these event types that creates dummy events whenever Plays are updated and use the stock Events post type that comes with a plugin.

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
Does anyone know if there is a plugin like this?
For a martial arts school, we have classes that are the same times every week. We'd like members to be able to sign up for a class per instance, and then the instructor teaching that class pulls up the list and checks them in.

fuf
Sep 12, 2004

haha

Uziel posted:

Does anyone know if there is a plugin like this?
For a martial arts school, we have classes that are the same times every week. We'd like members to be able to sign up for a class per instance, and then the instructor teaching that class pulls up the list and checks them in.

Stuff like that is always kind of a nightmare in my experience but "Events Calendar Pro" is pretty well regarded:
https://theeventscalendar.com/product/wordpress-events-calendar/

It has a ticketing component that you could probably adapt to a class sign-up thing. Someone has probably already done it somewhere.

GigaFuzz
Aug 10, 2009

Uziel posted:

Does anyone know if there is a plugin like this?
For a martial arts school, we have classes that are the same times every week. We'd like members to be able to sign up for a class per instance, and then the instructor teaching that class pulls up the list and checks them in.

I've used Team Booking for something similar in the past. It integrates with a Google Calendar for a lot of its functionality, which could be either a plus or a minus. It's cheaper than Events Calendar Pro, though.

I don't have access to it now, but I think either the admin backend and/or the google calendar event can give you a list of signups.

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.

GigaFuzz posted:

I've used Team Booking for something similar in the past. It integrates with a Google Calendar for a lot of its functionality, which could be either a plus or a minus. It's cheaper than Events Calendar Pro, though.

I don't have access to it now, but I think either the admin backend and/or the google calendar event can give you a list of signups.
Thanks, this looks closest to what we need, but being able to actually check in some as attending and then seeing who signed up vs who actually showed up historically is the pièce de ré·sis·tance. Do you recall if that is something done out of the box?

tankadillo
Aug 15, 2006

This is mostly a question about best practices:

I thought it would look nice to use the private_title_format filter to replace the "Private:" text with an SVG lock icon. Then I noticed that one of my plugins outputs the title inside an HTML attribute, but doesn't escape it or run wp_kses first. So the end result has mangled HTML.

Is that just an example of a bad plugin, or is putting code inside a title just a bad idea that's likely to cause more headaches down the road?

Misc
Sep 19, 2008

you might be better off using CSS with a before attribute rather than markup to insert the icon

tankadillo
Aug 15, 2006

That's what I figured. I was moving away from those just to cut down on HTTP requests, but there seem to be trade-offs either way.

Data Graham
Dec 28, 2009

📈📊🍪😋



What is the generally best-practicey way to do a restaurant site in WP that has an individual page for every location?

The site I'm wrestling with has 21+ locations (and growing worrisomely fast), and every single one of the locations has its own page. The hours and menus and amenities for every location are slightly different, and those hours and menus change often, so every few weeks I'm manually editing every one of those pages individually.

Is there a templating system available that I can use for this? Some way to centrally define bits of data and have all the location pages just read in the specific location's data?

Or am I better off pitching building them an actual custom site with a real self-contained database and ditching WP?

kedo
Nov 27, 2007

Data Graham posted:

What is the generally best-practicey way to do a restaurant site in WP that has an individual page for every location?

The site I'm wrestling with has 21+ locations (and growing worrisomely fast), and every single one of the locations has its own page. The hours and menus and amenities for every location are slightly different, and those hours and menus change often, so every few weeks I'm manually editing every one of those pages individually.

Is there a templating system available that I can use for this? Some way to centrally define bits of data and have all the location pages just read in the specific location's data?

Or am I better off pitching building them an actual custom site with a real self-contained database and ditching WP?

If it were me, I'd set up a custom template that I'd use for every location. I would then create a group of Advanced Custom Fields that would apply to that template and to an options page that would contain the default content if a single location hasn't provided override content.

Something like this:

PHP code:
<?php 
  $restaurant_name = get_field('restaurant_name'); // Try to get the name for this location
  if (!$restaurant_name) { // Name doesn't exist for this location
    $restaurant_name = get_field('restaurant_name', 'option'); // So get it from the default options page instead
  }
?>
<h1 class="location__name"><?php echo $hours_of_operation; ?></p>

<?php 
  $hours_of_operation = get_field('hours_of_operation'); // Try to get hours of operation from this Location
  if (!$hours_of_operation) { // Hours of operation don't exist for this location
    $hours_of_operation = get_field('hours_of_operation', 'option'); // So get it from the default options page instead
  }
?>
<p class="location__hours-of-operation"><?php echo $hours_of_operation; ?></p>
The one thing that is never easy for any restaurant website is the menu. There is literally no good solution here unless you can convince your client to store all their menus with a third party service Single Platform or whatever other service so that you can push the menu updates back onto the client and then simply embed a widget or fetch content from an API or something.

From another perspective: while updating menus manually is incredibly tedious, it at least provides a reliable stream of work. :shrug:

e: Another option would be to setup all of these pages, create WP accounts for each location manager and use a permission plugin to only allow each manager to edit their own page. There are a slew of different permission plugins out there, so pick your favorite. However unless you can get the owner on board with this idea it will never work because restaurant managers are always overworked and underpaid and updating the website will fall into their "stuff I will literally never do unless someone threatens to fire me" list unless the owner forces them to do so.

kedo fucked around with this message at 20:49 on Dec 26, 2018

Data Graham
Dec 28, 2009

📈📊🍪😋



Oho! Nice-looking plugin. I'll give that a deeper look.

That and/or "Insert Pages", because ACF requires WP 4+ and I don't think I want to try a major upgrade on this monstrosity I've inherited :doh:

Good call on pushing back on the client in any case. I had just sent off an email that, instead of a proposal/estimate, said "Uh hey so could we maybe group the stores into permanent or semi-permanent categories so we can consolidate their hours a little bit, instead of literally every single one being different? If we don't do that it doesn't matter what technological platform we use, we'll be hunt-and-pecking our way through the updates forever, and it'll just get worse (read: more expensive) the more stores you open"

kedo
Nov 27, 2007

You may be able to find an old version of ACF out there somewhere, but honestly if the site isn’t even on WP 4 it surely has pretty huge security vulnerabilities. Updating will be cheaper for you and the client in the long term so as to avoid an inevitable hack.

ACF is a core plugin for a huge number of WP sites these days, so if you haven’t played with it, man is your life about to change. :)

kedo fucked around with this message at 00:56 on Dec 27, 2018

Data Graham
Dec 28, 2009

📈📊🍪😋



What are the risks in upgrading WP? Is it fairly foolproof or is there a chance the whole thing will explode and/or the existing plugins will stop working?

kedo
Nov 27, 2007

It’s definitely possible that some plugins might stop working. My usual process is to download the site files/database to my local box, set up the site on MAMP and then upgrade it locally to see if it breaks before doing it on the live site. As long as there are no major errors that cause the site to stop loading, you’ll probably be fine.

And it hopefully goes without saying that you should keep copies of those files and the database in case you need to revert!

You might want to check the php/MySQL versions on your server too - I’m pretty sure WP 4 and 5 have different requirements than 3.

Data Graham
Dec 28, 2009

📈📊🍪😋



It actually looks like I'm on WP 4.3.18, so I (or someone) must have updated it at some point in the past. I think ACF requires 4.4+.

This is where I let slip that I'm very light on WP fundamentals. Is there even a database? How do I get to it? I don't see anything in the toolbar suggesting there is one. The only plugins that use databases store their data in some offsite service.

I mean obviously there is a database underlying it somewhere, but I think this is on wordpress.org (at least, there's a link to wordpress.org in the W menu in the toolbar), so I'm assuming there's just a global instance that this site lives in.


e: Oh wait, I found this https://codex.wordpress.org/WordPress_Backups

e2: ... Which doesn't seem applicable, it's generic. I have no idea what hosting service this thing is running on if not wordpress.org.

Data Graham fucked around with this message at 03:16 on Dec 27, 2018

the heat goes wrong
Dec 31, 2005
I´m watching you...
Security updates get backported to older versions also. Currently WP 3.7 still gets security updates released for it. So he should be okay on that end.

E; Actually, it depends on if he has minor updates allowed or are all updates blocked. Check your wp-config file for that info. If even minor security updates are blocked, then I hope you have good backups, because your site has many widely known and public security holes :D

the heat goes wrong fucked around with this message at 09:10 on Dec 27, 2018

kedo
Nov 27, 2007

Data Graham posted:

It actually looks like I'm on WP 4.3.18, so I (or someone) must have updated it at some point in the past. I think ACF requires 4.4+.

This is where I let slip that I'm very light on WP fundamentals. Is there even a database? How do I get to it? I don't see anything in the toolbar suggesting there is one. The only plugins that use databases store their data in some offsite service.

I mean obviously there is a database underlying it somewhere, but I think this is on wordpress.org (at least, there's a link to wordpress.org in the W menu in the toolbar), so I'm assuming there's just a global instance that this site lives in.


e: Oh wait, I found this https://codex.wordpress.org/WordPress_Backups

e2: ... Which doesn't seem applicable, it's generic. I have no idea what hosting service this thing is running on if not wordpress.org.

WordPress.com is the hosting service run by Automattic (the company that spearheads WordPress development), and WordPress.org is the site where you can download the software itself to run on your own server. So your site is most likely not hosted by WordPress. You can find out exactly where your database lives by checking your wp-config.php file. It'll have the database name, login info, etc. Depending on how the site's host works you'll access it via phpMyAdmin, or the MySQL CLI, or (hopefully not) through some (likely terrible) cpanel interface. I'd imagine your client will know where it's hosted.

There are lots of ways to copy a site from one server to another, and lots of plugins that will do most of the work for you. All in One WP Migration is probably the most popular option, it's dead simple to use.

That all being said, 4.3.18 isn't that far back, so it'll probably be okay to update the thing. Ye be forewarned – if you update all the way to 5.0 you'll also need to install the Classic Editor plugin, as 5.0 included a completely new editor.

blaise rascal
May 16, 2012

"Duke, Duke, Duke, Duke of Pearl...."
Hello, thread. I want to help a coffee shop make a simple website, and my only webdev experience is messing around with html and css.

I guess I'll install wordpress, and see how easy its website builder is to use. If it seems appropriate for our needs, then I might make these coffee shop owners a bluehost account using their email address, but I'll also know the account password.

Then maybe I'll build their website on my personal computer, but also get them to install wordpress on their computers, so they can edit the website in the future. Sounds like a plan?

It's tricky to strike a balance between how much they are in charge and how much I am in charge. They want nothing to do with technology, and want me to do as much as possible, but I don't want them to be so dependent on me that it's impossible for them to change the website in the future if I'm no longer around.

blaise rascal
May 16, 2012

"Duke, Duke, Duke, Duke of Pearl...."
I guess there's also no reason why I can't just use wordpress.com for hosting.

kedo
Nov 27, 2007

It sounds like your best bet would be to buy a pre-made theme from someplace like Theme Forest. Jumping into creating your own theme with only some experience in HTML and CSS would be a bad move. The client won't need to install anything on their computer – WordPress runs on a server, so they'd only need to interact with the live site. You would benefit from having a copy of it installed locally on your computer for development.

Adbot
ADBOT LOVES YOU

tankadillo
Aug 15, 2006

Having made a website for a local business before, WordPress.com is definitely a solid move. It makes the whole process a lot simpler, and they have a lot of good themes available. You can't add plugins or modify theme files directly (unless you pay extra, I think), but you can still edit CSS. If it's just a coffee shop, I'm sure that's all they'll need.

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