Php 帮助我在Wordpress的模式标记中显示Post数据
我将为模式标记指定自定义字段,但它没有显示值。我们将感谢您在这个问题上的帮助 注意:自定义文件显示的数据超出了模式JSON代码。我只想在模式标记中显示数据。多谢各位 代码示例Php 帮助我在Wordpress的模式标记中显示Post数据,php,html,wordpress,web-deployment,jsonschema,Php,Html,Wordpress,Web Deployment,Jsonschema,我将为模式标记指定自定义字段,但它没有显示值。我们将感谢您在这个问题上的帮助 注意:自定义文件显示的数据超出了模式JSON代码。我只想在模式标记中显示数据。多谢各位 代码示例 <?php $hiring_organization = get_field('hiring_organization'); $organization_url = get_field('organization_url'); $online_apply = get_field('online_apply');
<?php
$hiring_organization = get_field('hiring_organization');
$organization_url = get_field('organization_url');
$online_apply = get_field('online_apply');
$form = get_field('form');
$industry_type = get_field('industry_type');
$employment_type = get_field('employment_type');
$job_published_date = get_field('job_published_date');
$job_expiry_date = get_field('job_expiry_date');
$job_location = get_field('job_location');
$address = get_field('address');
$postal_code = get_field('postal_code');
$min_salary = get_field('min_salary');
$max_salary = get_field('max_salary');
$responsibilities = get_field('responsibilities');
$skills = get_field('skills');
$qualification = get_field('qualification');
$experience = get_field('experience');
$salary_base = get_field('salary_base');
?>
<!-- START SCHEMA -->
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "JobPosting",
"title": "<?php the_title(); ?>",
"description": "<?php the_content(); ?>",
"hiringOrganization" : {
"@type": "Organization",
"name": "<?php $hiring_organization; ?>",
"sameAs": "<?php $organization_url; ?>"
},
"industry": "<?php $industry_type; ?>",
"employmentType": "<?php $employment_type; ?>",
"datePosted": "<?php $job_published_date; ?>",
"validThrough": "<?php $job_expiry_date; ?>",
"jobLocation": {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"streetAddress": "<?php $address; ?>",
"addressLocality": "<?php $job_location; ?>",
"postalCode": "<?php $postal_code; ?>",
"addressCountry": "PK"
}
},
"baseSalary": {
"@type": "MonetaryAmount",
"currency": "PKR",
"value": {
"@type": "QuantitativeValue",
"minValue": <?php $min_salary; ?>,
"maxValue": <?php $max_salary; ?>,
"unitText": "<?php $salary_base; ?>"
}
},
"responsibilities": "<?php $responsibilities; ?>",
"skills": "<?php $skills; ?>",
"qualifications": "<?php $qualification; ?>",
"educationRequirements": "<?php $qualification; ?>",
"experienceRequirements": "<?php $experience; ?>"
}
</script>
<!-- END SCHEMA -->
{
“@context”:”https://schema.org/",
“@type”:“职位发布”,
“名称”:“名称”,
“说明”:“,
“雇佣组织”:{
“@type”:“组织”,
“名称”:“,
“sameAs”:”
},
“工业”:“,
“employmentType”:“,
“已发布日期”:“,
“有效通过”:“,
“工作地点”:{
“@type”:“Place”,
“地址”:{
“@type”:“PostalAddress”,
“街道地址”:“,
“地址地点”:“地址地点”,
“postalCode”:“,
“地址国家”:“主键”
}
},
“基本工资”:{
“@type”:“MonetaryAmount”,
“货币”:“PKR”,
“价值”:{
“@type”:“QuantitativeValue”,
“minValue”:,
“最大值”:,
“unitText”:”
}
},
“责任”:“,
“技能”:“,
“资格”:“,
“教育要求”:“,
“体验要求”:
}
请记住_title();和_内容();正在显示数据。只有自定义填充的数据不显示。谢谢问题解决了。
我忘记了变量之前的echo。php代码只需要在变量之前使用echo,如。
“name”:“
而不是“name”:“
您必须回显您的变量