Grymfogel1 Grymfogel1 - 1 year ago 55
PHP Question

Get content from WordPress to php

I've been trying to get information from WP for a while now and I still can't get it to work. What I'm trying to do is to get the information from an online resume and display it on the site.

The problem is that I haven't worked with WP a lot before and I can't figure out if there is a better way than SQL extraction to get that information.

This is the code I have now, it's very simple but doesn't work.

$output = '

<link rel="stylesheet" type="text/css" href="style1.css">

<div id="header">
<h1 class="title">'.the_custom_field('_candidate_name', 144).'</h1>
<ul class="contactInformation">
<li id="fullName">//This is where the name should go</li>
<li id="adress">//I want to fetch the adress and echo it here etc.</li>
<li id="phoneNumber"></li>
<div id="resumePicture">
<img src="mVqghXM.jpg" height="auto" width="100px">

<div id="education">


<div id="experience">



I've tried using get_custom_field as well as get_resume_field and placing them into a variable but i get an error that says it's undefined, and I presume that is because I don't have the WP Job Manager Field Editor plugin.

I would rather find another way to do this, either via some other WP compatible function or via SQL, instead of having to buy that plugin.

I would also love one of you to explain to me briefly how the WP system/database is built, because that would help immensely.

Thank you!

EDIT: I found the way of fetching the data from the database. It was get_resume_field, but what I'd done was copy the meta_key straight off the database, being "_candidate_name", but when I took the first underscore away, it worked. Thank you both for helping with the two problems I had. Cheers!

Answer Source

Use three files in your custom php file to get and use all wordpress function. Try this.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download