| Server IP : 172.67.201.108 / Your IP : 216.73.216.11 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/home2/mommydevcary/davler-mommybites/sitemaps/ |
Upload File : |
<?php
require_once '../wp-config.php';
global $wpdb;
$days_ago_time = strtotime("-30 days"); // TESTING: THIS SHOULD BE -30 days
$days_ago = date('Y-m-d', $days_ago_time);
$query = "SELECT * FROM mom_job_post WHERE
approved_date > '". $days_ago ."'
AND status = 'approved'
AND is_deleted != 'yes' ";
$result = $wpdb->get_results($query,ARRAY_A);
foreach ($result as $row)
{
$str .= 'https://mommybites.com/newyork/job-information/?hashid='.$row['hash'].'-'.$row['id']."\n";
}
$file = 'jobs.txt';
$d = date('Y-m-d');
$str2 = '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
foreach ($result as $row)
{
$str2 .= "<url>\n";
$str2 .= '<loc>https://mommybites.com/newyork/job-information/?hashid='.$row['hash'].'-'.$row['id']."</loc>\n";
$str2 .= "<lastmod>".$d."</lastmod>\n";
$str2 .= "</url>\n";
}
$str2 .= '</urlset>';
$file = 'jobs.xml';
$current = file_get_contents($file);
file_put_contents($file, $str2);
?>