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
v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.
Why does anyone update anything? Bugfixes, compatibility fixes, new features. As happy as I am to fix issues in other peoples themes, I'd much rather submit a fix and then pull down an update. Plus, like any other library, updates should be backwards compatible unless indicated otherwise.

Maintaining compatibility with someone's theme while making my own changes - that's the hard part. I normally segregate custom these code into my own directory, but the root theme files (templates, header) are usually a bit of a poo poo show that require manual intervention (diff) to pick customisations from updates.

Of course, there's no reason for you to update the theme you're using if you're happy with how it's working.

Adbot
ADBOT LOVES YOU

Bradzor
Mar 18, 2007
Fwhaa?

fuf posted:

Why do people do theme updates?

Plugins and core updates of course, but once a site looks how you want it why would you update the theme and risk changing the appearance? Is it just in case the updates have new browser / device support?

Themes include more than just HTML/CSS, most theme updates are bugfixes, security updates, more functionality, etc

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

Bradzor posted:

To avoid the problem of losing it on a theme update, just make a new PHP file in your plugins directory and add a plugin header to it. You also want to make sure you prefix your function, so that if a function named 'excerpt_length' exists, your site won't break.

Thanks.:)
Turns out that making plugins is way easier than I thought. After seeing this I made my first plugin that filters visible categories. yay progress!

Robot Arms
Sep 19, 2008

R!
I'd like to have a "safety" for the Schedule/Publish button. Even just an "Are you sure you want to do that?" pop-up would help keep me from publishing posts when I just mean to change their status. Has anyone encountered a plugin like this? If not, how would I do this myself?

my bony fealty
Oct 1, 2008

samglover posted:

I'd like to have a "safety" for the Schedule/Publish button. Even just an "Are you sure you want to do that?" pop-up would help keep me from publishing posts when I just mean to change their status. Has anyone encountered a plugin like this? If not, how would I do this myself?

This looks like what you want:

https://wordpress.org/plugins/confirm-publishing-actions/

Robot Arms
Sep 19, 2008

R!
That's perfect. Thanks!

painted bird
Oct 18, 2013

by Lowtax
Is this the place to ask for Wordpress-specific help or do I go to the PHP thread if I can't figure out how to write something in PHP?

fuf
Sep 12, 2004

haha
just post :)

fuf fucked around with this message at 18:19 on Jul 20, 2015

huhu
Feb 24, 2006
I've just started helping an NGO with their current WordPress website. My first thought was to backup everything so that if I mess anything up I can recover and also to have a locally hosted copy that I could mess around with first before uploading changes. Is there anything else I should definitely focus on doing? Otherwise, I was going to start working on getting the plugins/news/etc updated and then start working on improving the theme (which they asked me to work on).

Boosh!
Apr 12, 2002
Oven Wrangler
WP newb here with a tiny blog. My company's website wants to highlight the 4 latest posts which I was getting successfully via Google Feed API + javascript.

My problem: For some reason it is now showing ancient content, stuff I deleted weeks ago.

I wondered if it was an issue with the Google Feed API but I tested another reader and still experienced the problem. Hitting the RSS URL directly shows the updated content which is weird. Has anyone experienced this?

edit: Apparently that other reader, was built on top of Google's Feed API. So frustrating!

Boosh! fucked around with this message at 21:11 on Jul 21, 2015

spiritual bypass
Feb 19, 2008

Grimey Drawer

huhu posted:

I've just started helping an NGO with their current WordPress website. My first thought was to backup everything so that if I mess anything up I can recover and also to have a locally hosted copy that I could mess around with first before uploading changes. Is there anything else I should definitely focus on doing? Otherwise, I was going to start working on getting the plugins/news/etc updated and then start working on improving the theme (which they asked me to work on).

Version control. Setting up a local git repo is trivial, so do it.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
I've noticed a new-ish thing on news websites, where scrolling down on a page changes the url in the browser, without loading a new page. I was wondering, is there a plugin that automates that for Wordpress posts in a specific category?

Example (this may only work on a desktop): http://www.theonion.com/graphic/highlights-go-set-watchman-50907 Scroll down and you can see what I'm talking about.

Sad Panda
Sep 22, 2004

I'm a Sad Panda.
iThemes security is throwing up 404s because in my pages there is

<link rel="shortcut icon" href="/wp-content/uploads/2014/04/favicon1.png" />

even though that file definitely exists.

So I have 2 questions.
1. Why would that be?
2. Is there anyway to find where that is defined in my themes or plugins? I'm using Divi and can not see any mention of that in header.php. I'm planning on replacing it with a .ico assuming I can find the line.


question 2 resolved - found it in one of the Divi options. I still don't know why it would be however.

Sad Panda fucked around with this message at 10:28 on Jul 28, 2015

spiritual bypass
Feb 19, 2008

Grimey Drawer
I'm about to inherit hosting and maintenance contracts for a bunch of Wordpress sites from a design shop that doesn't want to deal with Wordpress anymore. The prospect of upgrading the core and plugins of a dozen poorly built sites doesn't exactly appeal to me, though.

Is there any reason I shouldn't migrate all of them into a single WPMU installation? It seems like this would save me a lot of trouble, but I want to make sure I'm not going to be causing even more of a headache. Any reflections from someone who's done this before will be useful.

kedo
Nov 27, 2007

Sad Panda posted:

iThemes security is throwing up 404s because in my pages there is

<link rel="shortcut icon" href="/wp-content/uploads/2014/04/favicon1.png" />

even though that file definitely exists.

So I have 2 questions.
1. Why would that be?
2. Is there anyway to find where that is defined in my themes or plugins? I'm using Divi and can not see any mention of that in header.php. I'm planning on replacing it with a .ico assuming I can find the line.


question 2 resolved - found it in one of the Divi options. I still don't know why it would be however.

If it's 404ing it doesn't exist at that location, or with that file extension, or whatever. The browser isn't going to lie to you about that.

Since it's pointing to something in the /uploads/ folder I would hazard a guess that your theme provides you an upload option somewhere on a settings page. I'd look for that before you start editing code.

Otherwise, get a text editor (ie. Sublime Text or TextMate or something) that allows you to do a find across all files in a folder and search for "shortcut icon" in your theme directory.

fuf
Sep 12, 2004

haha

rt4 posted:

I'm about to inherit hosting and maintenance contracts for a bunch of Wordpress sites from a design shop that doesn't want to deal with Wordpress anymore. The prospect of upgrading the core and plugins of a dozen poorly built sites doesn't exactly appeal to me, though.

Is there any reason I shouldn't migrate all of them into a single WPMU installation? It seems like this would save me a lot of trouble, but I want to make sure I'm not going to be causing even more of a headache. Any reflections from someone who's done this before will be useful.

If they're badly built then core files might have been changed and they might break when you do a core / plugin update. That's one reason it can be useful to keep the installations separate. I host a couple of sites where the original developer literally specified "Don't ever update WordPress or the site will break" so I have to just leave them alone. It sucks but the client won't pay me to rebuild them properly.

My question: does anyone have a good skeleton / starter theme alternative to Bones? I like Bones but it adds just a bit too much unnecessary stuff (multi-language support for example) and all those comments take a while to clean up.

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
Sage from roots.io is pretty good

fuf
Sep 12, 2004

haha
Thanks, yeah I tried that for a while (back when it was just Roots). The dev posts here I'm pretty sure.

But again it's just a little too feature-packed with their own template wrapper etc.

I want something really barebones. gently caress I should obviously just make one from scratch myself shouldn't I? :(

fuf
Sep 12, 2004

haha
Does anyone who knows about Advanced Custom Fields know if it's possible to retrieve the three most recent repeater fields across all posts?

I have a custom post type "Director" with a repeater field "Movies" and I want to retrieve the three latest movies from amongst all Directors.

e: nm found this http://www.advancedcustomfields.com/resources/querying-the-database-for-repeater-sub-field-values/

fuf fucked around with this message at 15:48 on Jul 31, 2015

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
I'm upgrading someone's static site to wordpress, so what I've done is I installed wordpress in a subdirectory there until I've got it where I want it. When I'm ready to make this thing live, shouldn't it be as easy as setting the site address to the root and then deleting the existing index.html? Is there anything I should watch out for?

Another question: I'm building a "press releases" section, with around 150 different pages, and the options for ordering the different press releases are by date, author, title, date modified, slug, and ID. We want these to go in a specific order, so slug or ID are the only viable options. Is that going to mean adding a 001-, 002- etc prefix to every slug, and is there anything wrong with doing that? I'd love to simply put an ID of 001, 001 for each one, but I can't find where to set that.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

jackpot posted:

I installed wordpress in a subdirectory [...] shouldn't it be as easy as setting the site address to the root and then deleting the existing index.html? Is there anything I should watch out for?

Uh.. for the simplest setup, I would probably migrate Wordpress to the root of the hosting, otherwise it'll still only be accessible by going to /my-wordpress-thing/, right? Wordpress doesn't just "take over" the domain because you change its config.
You can do this in another way with the right .htaccess rewrite rules, with is another option, but unless you know what you're doing it can be fraught with giant pain-in-the-rear end problems.

Also, when you make links in wordpress it typically makes them absolute, with the root of the URL being the URL you specified in the config. When you go to have your site at "/" you might find your links still point to "/my-wordpress-thing/". You can use a plugin like Better Search and Replace to switch out the URLs. I'm sure there's a CLI version of this people recommend, but I can't remember it.

jackpot posted:

"press releases" section [...] options for ordering the different press releases are by date, author, title, date modified, slug, and ID. We want these to go in a specific order, so slug or ID are the only viable options. Is that going to mean adding a 001-, 002- etc prefix to every slug, and is there anything wrong with doing that?
:what:
Yeah, don't do that.

Take a look at this article which gives some options on specifying the ordering.
I mean, those other options are there so your users can more easily find what they're looking for, but I get that for press releases you want it to be more rigid. Still, don't impose lovely rules on your data just to impart functionality.

fuf
Sep 12, 2004

haha

v1nce posted:

I'm sure there's a CLI version of this people recommend, but I can't remember it.

wp-cli.org

The database search-replace and import / export commands are super helpful.

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
Ok, so let me start from the beginning and tell you what I'm trying to do - I'm not very far along into this, so no harm done yet. We're rebuilding this site; used to be just static html, now gonna be wordpress. So I installed this template at https://www.site.com/newproject, because under General Settings it says:

quote:

Many people want WordPress to power their website's root (e.g. http://example.com) but they don't want all of the WordPress files cluttering up their root directory. WordPress allows you to install it into a subdirectory, but have your website served from the website root.

...followed by instructions on how to do that. Have I read that all wrong, or is this the htaccess method you were talking about?

v1nce posted:

Yeah, don't do that.
You're right, that's pretty dumb. As long as we create these entries in chronological order, oldest first (or whatever order the client wants), then we'll be fine.

frogbs
May 5, 2004
Well well well
I've been tasked with transitioning an old Drupal 6 site over to Wordpress. There are 5,000-ish articles to be moved over, all with photos or photo galleries. Ideally i'd like the articles to come over with the photos/galleries attached and uploaded as media in Wordpress. I'm not a database guy or super familiar with Drupal, so i'm exporting the stories the only way I know how, through Drupal's Views module as XML. Then i'm importing into Wordpress using a plugin called WP-All-Import.

For some reason photos and photo galleries are included in the XML feed as escaped HTML, not their own nodes in the XML. My solution was to output articles, photos, and photo gallery Drupal nodes as separate XML files and do some regex find/replace to standardize photo names across the 3 xml files. Upon import Wordpress should marry the photos up to the articles...hopefully.

My question is, is there an easier way? There's info out there about transitioning Druapl 6 over to WP, but none of it seems to deal with my Photo/Gallery issue.

Any thoughts or ideas are welcome and appreciated!

frogbs fucked around with this message at 00:07 on Aug 7, 2015

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

jackpot posted:

...followed by instructions on how to do that. Have I read that all wrong, or is this the htaccess method you were talking about?
Oh, yeah, that'll work. Your asset URIs might still look squiffy if you give a poo poo (everything going to site.com/newsite) but that probably doesn't matter too much to you, providing the page URLs look OK, which they will.

jackpot posted:

As long as we create these entries in chronological order, oldest first (or whatever order the client wants), then we'll be fine.
You can set the publish date on the article, so it doesn't really matter what order you make them in.

frogbs posted:

I've been tasked with transitioning an old Drupal 6 site over to Wordpress.
I can only tell you that I looked at doing this same thing, but I abandoned ship. You sound like you're way further ahead than I ever was.
Providing your URLs resolve (assuming your images are in the body of the content, not attached to the articles some other way?) you should be golden. IIRC wordpress doesn't manage media by ID inside articles, just like it doesn't manage URIs to articles. It's all just raw HTML.
If they're not part of the content then I guess you need to set up something like ACF, in which case the IDs will matter.

Honestly I'd just say suck it and see. You've got enough working in the process that your only problem is going to be time.

frogbs
May 5, 2004
Well well well

v1nce posted:

Oh, yeah, that'll work. Your asset URIs might still look squiffy if you give a poo poo (everything going to site.com/newsite) but that probably doesn't matter too much to you, providing the page URLs look OK, which they will.

You can set the publish date on the article, so it doesn't really matter what order you make them in.

I can only tell you that I looked at doing this same thing, but I abandoned ship. You sound like you're way further ahead than I ever was.
Providing your URLs resolve (assuming your images are in the body of the content, not attached to the articles some other way?) you should be golden. IIRC wordpress doesn't manage media by ID inside articles, just like it doesn't manage URIs to articles. It's all just raw HTML.
If they're not part of the content then I guess you need to set up something like ACF, in which case the IDs will matter.

Honestly I'd just say suck it and see. You've got enough working in the process that your only problem is going to be time.

It's weird because the photos and galleries ARE completely separate node types in Drupal, but when exported as XML the Views module just includes references to them inline inside the <description> field in XML. I'd love it if it looked like this:

<item>
<photos>
<photo>
<src>path/to/file.jpg</src>
<photoid>12345</photoid>
<caption>Lorem ipsum</caption>
</photo>
</photos>
<description>
Article text
</description>
</item>

What I'm getting instead looks like:

<item>
<description>
Photoid=12345
Article text
</description>
</item>

I'm having to match the photoid up semi-manually using another export of all the Photo nodes from Drupal.

There's probably a way to do this all via sql, but I feel like it would take me a long time to figure it out...

Omits-Bagels
Feb 13, 2001
Is there a way to convert posts to pages without screwing up SEO (I want to keep the URLs exactly the same).

kedo
Nov 27, 2007

I've been working with WordPress for ages but am relatively new to plugin writing. As a learning exercise, I'm in the process of writing a simple plugin that returns certain post data in a custom format after a user clicks a button on the edit screen.

Currently I have the button on the edit screen sending folks to /plugindirectory/foo.php?id=[the post id]. My question is this – how the heck do I retrieve post data in foo.php? I'm assuming I need to require some PHP in there in order to be able to get_post() or what have you, but I'm novice enough that I'm not sure where to start.

Can anyone point me in the right direction?

snagger
Aug 14, 2004

kedo posted:

I've been working with WordPress for ages but am relatively new to plugin writing. As a learning exercise, I'm in the process of writing a simple plugin that returns certain post data in a custom format after a user clicks a button on the edit screen.

Currently I have the button on the edit screen sending folks to /plugindirectory/foo.php?id=[the post id]. My question is this – how the heck do I retrieve post data in foo.php? I'm assuming I need to require some PHP in there in order to be able to get_post() or what have you, but I'm novice enough that I'm not sure where to start.

Can anyone point me in the right direction?

Your objective comes in two chunks:
1. Retrieving a custom post. You'll probably need to run a query on the custom post type and then construct a loop: https://codex.wordpress.org/Post_Types#Querying_by_Post_Type
2. Output your post data as form field default values, rather than as plain old HTML.

kedo
Nov 27, 2007

snagger posted:

Your objective comes in two chunks:
1. Retrieving a custom post. You'll probably need to run a query on the custom post type and then construct a loop: https://codex.wordpress.org/Post_Types#Querying_by_Post_Type
2. Output your post data as form field default values, rather than as plain old HTML.

Yep, I assumed as much. However my problem is that right now my PHP file has zero connection to the rest of WP, so I can't even begin to construct a loop because everything is undefined.

Here's the structure I have currently:

pluginfile.php
foo.php

pluginfile.php inserts a "click me" button on the post edit screen. Clicking the button sends the user to foo.php with the post ID attached as a URL parameter attached. My goal is to echo various stuff form the post in foo.php, but since it's a standalone PHP file I currently can't.

Am I approaching this in an asinine manner?

streetlamp
May 7, 2007

Danny likes his party hat
He does not like his banana hat
I think a solid boilerplate could help you out as far as how to properly structure a plugin and use WP functions
https://github.com/devinvinson/WordPress-Plugin-Boilerplate/

kedo
Nov 27, 2007

streetlamp posted:

I think a solid boilerplate could help you out as far as how to properly structure a plugin and use WP functions
https://github.com/devinvinson/WordPress-Plugin-Boilerplate/

You are likely very right about that. Thank you sir!

kedo
Nov 27, 2007

Can anyone recommend a solid, reliable user management plugin? I'm happy to pay for it assuming its of high quality (like ACF or Gravity Forms quality).

Things I need to be able to do:
• Bulk administer users
• More user levels/roles than the default options WP provides
• Display pages conditionally for users
• Disallow non-admin users from accessing the WP dashboard
• Ability to generate auth codes to email to users to allow them to set up accounts w/ a certain role
• e: Oh, and integrates nicely with Sales Force

kedo fucked around with this message at 16:43 on Aug 24, 2015

fuf
Sep 12, 2004

haha
Buddypress can probably do most of that and is pretty established in terms of reputation, plugins and documentation:
https://buddypress.org/

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
If I have an existing blog, at /blog, and I want to move/copy/export that blog's posts and images to a new blog (located at some other subfolder, using a new wordpress instance and theme), how would I do this? Because I know that I can do an export of the old blog, and then import that into the new blog, but even though the content and images are displaying, the paths to the images are all still pointing to the old blog (which makes sense, I should've expected that). So they're all at /blog/wp-content/uploads/2015/etc, when I want them to be at /totallynewblog/wp-content/uploads/2015/etc. Is this a matter of me copying that uploads folder from the old blog to the new, then doing a find/replace in the xml file for all the hundreds of references to these images? That sounds terrible.

jackpot
Aug 31, 2004

First cousin to the Black Rabbit himself. Such was Woundwort's monument...and perhaps it would not have displeased him.<
So I've read enough posts by frustrated people to know that Wordpress doesn't feel users can handle subfolders in their media library. So what plugins do smart people use to get around this utterly loving stupid thing?

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

jackpot posted:

Is this a matter of me copying that uploads folder from the old blog to the new, then doing a find/replace in the xml file for all the hundreds of references to these images? That sounds terrible.

fuf posted:

wp-cli.org

The database search-replace and import / export commands are super helpful.

Dr. Fishopolis
Aug 31, 2004

ROBOT
I'm building a subscription e-learning site with basically the same feature set as something like http://fizzle.co

I've been using WPMUDEV stuff because at first it seemed like they have all the plugins I would need to accomplish it, but they don't really have integration between their own plugins and most of their stuff is either abandoned or a cobbled-together beta. Nothing I would use for a production site anyway, so I'm back to the drawing board.

Any thoughts on LMS software? Sensei vs LearnDash vs WP Courseware?

I know everyone uses WooCommerce, but I don't like that Stripe support costs 78 bucks a year by itself, and that is a vital piece for me as I never use Paypal for anything if I can help it. Paid Memberships Pro seems like a solid alternative?

The final piece of the puzzle for me is forums, and it seems like bbpress is the "good enough" standard option. Anyone use anything better?

snagger
Aug 14, 2004

Dr. Fishopolis posted:

I'm building a subscription e-learning site with basically the same feature set as something like http://fizzle.co

I've been using WPMUDEV stuff because at first it seemed like they have all the plugins I would need to accomplish it, but they don't really have integration between their own plugins and most of their stuff is either abandoned or a cobbled-together beta. Nothing I would use for a production site anyway, so I'm back to the drawing board.

Any thoughts on LMS software? Sensei vs LearnDash vs WP Courseware?

I know everyone uses WooCommerce, but I don't like that Stripe support costs 78 bucks a year by itself, and that is a vital piece for me as I never use Paypal for anything if I can help it. Paid Memberships Pro seems like a solid alternative?

The final piece of the puzzle for me is forums, and it seems like bbpress is the "good enough" standard option. Anyone use anything better?

I have a learning site that runs profitably on WooCommerce/Sensei. Stripe may be $78 out of the box but subsequent year licenses only cost 50%. If $39/year is an expense that greatly concerns you, you may want to reconsider your business plan.

The Woo stack is easy to use for end users, easy to install and operate, and easily has the best support. We actually started with Paid Memberships Pro and migrated everything to WooCommerce because PMPro is basically one giant collection of awful short-term hacks and poor front-end work (see: non-responsive HTML tables on checkout page). Any time you want to make a modification (new currency? changing the trial mechanism?) you have to navigate their forums and deal with their staff. Woo's support is much, much better and the plugin ecosystem is far more established.

Giving WooCommerce $500 or so to get going on their stack was one of the better moves we made.

Adbot
ADBOT LOVES YOU

Dr. Fishopolis
Aug 31, 2004

ROBOT
Well after my experience with WPMUDEV, I'm more than done with lovely plugin support forums so Woo it is.

With the stripe support, it's not the expense that irks me, it's the idea of paying 80 bucks for a gateway implementation that is practically already written for them. It's a value proposition problem. If I reframe it as paying 80 bucks for a rock solid commerce plugin with great support, I'd pay twice. Humans are weird.

Anyone have any thoughts on forums?

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