a1exus
Forum Replies Created
-
sorry was AFK 😉
could you please provide a bit more details where exactly i need to update this?
thanks in advance!
Hello, I appreciate you trying to help me!
I’m not using any Page Builders or anything like that, I do believe that the only thing that I did do, is: I selected “Sherbet” style in “Styles” (one of many styles (presets) that comes with the theme).
Thanks again 😉
I’m using default settings and theme’ name is: Twenty Twenty-ThreeVersion: 1.6
i’ve got it to work (again) latest (working) php code is available at: https://gist.github.com/a1exus/30be3a17ef0b91308843240626a97428
I checked my sitemap but don’t see my two new ACF post types.
$ cat ./wp-content/mu-plugins/custom-jetpack-sitemap-20250317.php
<?php
/*
Plugin Name: Dynamic Post Types in Jetpack Sitemap (MU)
Description: Dynamically includes all registered public post types (including ACF types) in the Jetpack XML sitemap.
Version: 1.4
Author: ChatGPT
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Get all registered public post types for Jetpack sitemap.
*
* @return array List of valid public post types.
*/
function get_dynamic_sitemap_post_types() {
static $cached_types = null;
if ( is_null( $cached_types ) ) {
$excluded_post_types = ['attachment', 'revision', 'nav_menu_item'];
$all_post_types = get_post_types(['public' => true], 'names');
$cached_types = array_diff($all_post_types, $excluded_post_types);
}
return $cached_types;
}
/**
* Add public post types to Jetpack sitemap.
*
* @param array $post_types Existing post types in the sitemap.
* @return array Modified list of post types.
*/
function dynamic_jetpack_sitemap_post_types( $post_types ) {
return array_unique(array_merge($post_types, get_dynamic_sitemap_post_types()));
}
/**
* Hook into Jetpack sitemap filter once plugins are fully loaded.
*/
add_action('plugins_loaded', function() {
if ( class_exists( 'Jetpack' ) && method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'sitemaps' ) ) {
add_filter( 'jetpack_sitemap_post_types', 'dynamic_jetpack_sitemap_post_types' );
}
});
$- This reply was modified 1 year, 2 months ago by a1exus.
Hello Swish and thank you for your message, I really appreciate it!
now, I’ve added the following php code to wp-content/mu-plugins/custom-jetpack-sitemap.php file:
<?php
/*
Plugin Name: Custom Post Types in Jetpack Sitemap (MU)
Description: Adds "sponsor" post type to the Jetpack sitemap.
Version: 1.0
Author: ChatGPT
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
function custom_jetpack_sitemap_post_types( $post_types ) {
if ( post_type_exists( 'sponsor' ) ) {
$post_types[] = 'sponsor';
}
return $post_types;
}
add_filter( 'jetpack_sitemap_post_types', 'custom_jetpack_sitemap_post_types' );assuming the code is actually correct, how can one verifies that it actually _is_ working and my custom post_type got into sitemap?
this isn’t entirely true, however the correct answer is:
one must maintain 3 order a month threshold, otherwise Amazon WILL disable your API key
please follow my link: https://photos.app.goo.gl/LnysV7dDXv7HrrFE7
- This reply was modified 1 year, 11 months ago by a1exus.
update: i’m still seeing quite a few of
This item was added to your site after the most recent scan. We will check for threats during the next scheduled one.
even though i haven’t added anything (other than content), yet jetpack thinks otherwise..
Thank you for looking into this for me, I really appreciate that!
Is there a way for an average Joe to see that magical sync status with Jetpack somehow/somewhere? I hear awful a lot about that lately and it seems like me banging my head against the wall could have been something to do with Jetpack’ syncing issues, which again would be super helpful to see (probably would makes sense to incorporate that into main Dashboard in my opinion, or maybe i just didn’t find it)
- This reply was modified 1 year, 11 months ago by a1exus.
the error is no longer present, maybe the message was cached…
- This reply was modified 1 year, 11 months ago by a1exus.
ha! i actually just found Cloudflare feature
Always use HTTPS
Reply to all requests for URLs that use “http” with a 301 redirect to the equivalent “https” URL. If you only want to redirect for a subset of requests, consider creating an “Always use HTTPS” page rule.so I toggle it and now it’s enabled 😉 and now I have this
% curl -I http://youarebetter.com/ HTTP/1.1 301 Moved Permanently Date: Wed, 05 Jun 2024 19:46:34 GMT Content-Type: text/html Content-Length: 167 Connection: keep-alive Cache-Control: max-age=3600 Expires: Wed, 05 Jun 2024 20:46:34 GMT Location: https://youarebetter.com/ Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=dPNYSNabVa1%2FwWsC%2BH%2BtfrEYKDtwliYsJMETGWH9dyJgdvz2%2BZvXxKa%2BJ7tMaHF88RKhWfcFr%2BgkIO6CnkL0j%2BkYPnUO3OZj9Dkps809ZpJqdVJwHtP9B5XS6DP%2FXTYD3TjV"}],"group":"cf-nel","max_age":604800} NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800} Server: cloudflare CF-RAY: 88f2ab652c18ab1c-YYZ alt-svc: h3=":443"; ma=86400 %- This reply was modified 2 years ago by a1exus.
CloudFlare listens to both http (port:80) and https (port:443), and within wordpress home and siteurl both already set for https and not http:
[alexus@jj ~/youarebetter.com/wordpress]$ wp option get home https://youarebetter.com [alexus@jj ~/youarebetter.com/wordpress]$ wp option get siteurl https://youarebetter.com [alexus@jj ~/youarebetter.com/wordpress]$I’m using latest / stable PHP 8.3.6 which is available for my OS w/ libxml 2.11.7.
this is self-host, so I’m my own hosting provider and PHP IS configured properly, as phpinfo(); wouldn’t return XML Support active it that wasn’t the case..