Questions regarding an upcoming interview assessment involving WordPress

[ad_1]

I’m very new to WordPress but am very familiar with general front-end development. I have an upcoming interview assessment where I have to do as follows: ***”access a WordPress site that we have built and use PHP to query the database, pull a group of posts from a custom post type, and loop through the posts to grab their meta field data, then display that data in HTML, style it with CSS, and use JS to create a slider/carousel”***. The HTML, CSS, and JS I am completely comfortable with and should have no problems. PHP I am new but I understand its purpose and I understand SQL queries so most all it’ll take is getting comfortable with the syntax. However, as someone new to WordPress, I have a few questions regarding how WordPress works in this situation. When they say “access a WordPress site that we have built and use PHP to query the database”, should I expect to have to connect to this database remotely via the hosting provider’s server info where the credentials will be given to me like so :

​

mysql_connect($hostname,$username, $password) OR DIE (‘Unable to connect to database!’);
mysql_select_db($dbname);

or is it more likely they are going to send me the WordPress project to run on my local machine where I could use wpdb. If the latter is the case, where would I place my php, html, css, and js files in terms of file structure when it comes to a WordPress project?

TLDR, basically what I want is for someone with knowledge of WordPress to give me an idea of what I should be working on to prepare for assessment based on what the task they gave me says. The task of using php to query the database and displaying that info with html css and js is not the issue here, understanding what knowledge of WordPress I will need in order to access the database is. I understand there are probably a few ways they could administer this but I only wish to know what way makes the most sense to someone who is familiar with WordPress. Any assistance or pointing me towards resources is appreciated.

[ad_2]
3 Comments
  1. You don’t need to worry about the db connection ruin in WP – it’s defined globally and is handled inside the various functions that query the db.

    Like u/rapscallops said, you would use WP_query do perform the search for the CPT’s, then loop through the returned data and call get_post_meta to retrieve the meta data. Google is going to be your best friend here 😉

  2. I would definitely start to get your head around WordPress theme development concepts:

    This is the place to start learning about file structure, template hierarchy etc that you’ll need to have at least some basic familiarity with.

    As far as how you’ll be given access, no way to know but I suspect you’ll either be given a package with all files and a db, or perhaps access to a git repo.

    Good luck with the interview.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer