Looping through comma delimited values returned from wpdb SELECT statement

I have created a custom template in my theme to pull a list of account IDs from a custom table. The SELECT statement is as follows:

global $  wpdb; $  accounts = $  wpdb->get_results("SELECT ID FROM wp_2_local_calendar_acct;"); print_r($  accounts); 

this query returns this result:

Array ( [0] => stdClass Object ( [ID] => 3697,2558,2559,55467 ) )

Now that I have the list of IDs in a delimited format, I need to loop through them and execute a shortcode with each ID. I am trying to use 'foreach' but I can't figure out how to break the delimited list into these unique values:

3697

2558

2559

55467

How do I do this in PHP?

submitted by /u/just_southern
[link] [comments]
WordPress

Creating WordPress user accounts from a Microsoft Access database

Hello! I volunteer at my local organic food co-op doing various IT/web admin tasks. Currently, we're in the process of overhauling the website and want to create a part of the site that co-op members can log into to book their volunteer shifts, potentially vote on things and possibly do other member-specific tasks.

Our membership database currently runs on Microsoft Access. Would it be possible to take the ~2,000 members in the database and automatically create WordPress user accounts for them to log into the site? Their default password could be their date of birthday, say. We would also want to have the phone numbers, emails, date of birth and other useful pieces of data stored in the WordPress users database as well.

Any help would be greatly appreciated!! 🙂

submitted by /u/vj_njoy
[link] [comments]
WordPress

Just upgraded to a VPS from BlueHost and the traffic isn’t a lot. About 1k a day. And for some reason the website keeps crashing every other day and the developer says he needs to clear the caches to make it go live again. And he does and it works. He is using WP Rocket.

There is about 790GB of space in the drive and only 20% of total resources are being used at one time.

submitted by /u/slickster18
[link] [comments]
WordPress

Fairly new to MAMP – I’m attempting to install wordpress via instructions from a Skillshare video

So I am running Windows 7 and downloaded MAMP as a way to work on a WordPress site offline locally, I set up the database via phpMyAdmin and locally from the htdocs folder where I have the install ready. The issue? I constantly get this error:

Error establishing a database connection

This either means that the username and password information in your wp-config.phpfile is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down.

  • Are you sure you have the correct username and password?
  • Are you sure that you have typed the correct hostname?
  • Are you sure that the database server is running?

If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

Now granted, the video I am following is a tutorial on Mac OSX, but it shouldn't be that different? If it is, I would love some help on this, would be great to gain insight on how this all works, I am very pleased to have even discovered this local development tool for WordPress, to begin with!

If anyone wants the link to the skillshare lesson I am going through, and if it's okay to do so, I will post it to those that may want that extra bit of info.

submitted by /u/NightNinja_TFOA
[link] [comments]
WordPress

Where is this script tag coming from?!

Hi all,

I'm helping a friend with a small business out and their website is a bit of a mess. They use DIVI theme and have a script code on their website that I can't figure out how to remove. It doesn't show up in any of the plugins, I checked all the theme files, I even have access to the cpanel for their entire domain and did a regex search with no luck.

I tried the WP Plugin "String Locator" and it pops up nothing for the entire WP core folders.

Nonetheless, this script code loads up on every page of their website, and I need to remove it. I feel like I'm missing something easy but I don't work with WordPress all that often so after Googling for a few hours and crawling a few different resources, I came here.

Please help! How can I track down this script file and remove it from the website's pages?

submitted by /u/handofreason
[link] [comments]
WordPress

How do i change a title from h1 to p ….please help! Will buy you a beer in Bitcoin

So i finished this website www.pergolaorienta.it and i have one last problem…. in the sections "modelli" and "accessori" the titles of each item are automatically generated by the theme to be H1, this gives it a really bad SEO score.

I would like to change that so that it is a custom "p" class…

if anyone can help i would be glad to buy you a beer (send a btc adress)

submitted by /u/govdo
[link] [comments]
WordPress