Jay
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Archive page for “standard” Post Format posts?I found an even better way to do this.
When you navigate to
/type/standard
, WordPress does try to perform a query onpost_format = post-format-standard
, but that just doesn’t return anything, because there is nopost-format-standard
.So you can add a
pre_get_posts
action to perform this query if WP is “trying” to get standard posts this way:function standard_posts( $query ) { if ( $query->get( 'post_format' ) === 'post-format-standard' ) { $query->set( 'tax_query', array( array( 'taxonomy' => 'post_format', 'operator' => 'NOT EXISTS' ) ) ); $query->set( 'post_format', NULL ); } } add_action( 'pre_get_posts', 'standard_posts' );
The output of
the_archive_title
would just beArchives
, so you can fix this in this slightly hacky way:function standard_posts_archive_title( $title ) { if ( is_tax() && $title === 'Archives' ) { return __( 'Standard Posts' ); } return $title; } add_filter( 'get_the_archive_title', 'standard_posts_archive_title', 10, 1 );
Forum: Developing with WordPress
In reply to: Archive page for “standard” Post Format posts?Because the
wp:query
block doesn’t natively support theNOT EXISTS
operator, I had to create this custom filter:// https://wordpress.stackexchange.com/a/422394/2478 function nopostformat_query_loop_block_query_vars( $query, $block ) { if ( $block->context['query']['noPostFormat'] ) { $query['tax_query'] = array( array( 'taxonomy' => 'post_format', 'operator' => 'NOT EXISTS', ), ); } return $query; } add_filter( 'query_loop_block_query_vars', 'nopostformat_query_loop_block_query_vars', 10, 2 );
Then, in my block template file:
<!-- wp:query { "query": { "perPage": 2, "postType": "post", "order": "desc", "orderBy": "date", "noPostFormat": true } } -->
Forum: Developing with WordPress
In reply to: Archive page for “standard” Post Format posts?Thanks @gappiah — Should it be possible then to navigate to an archive page for which
post_format
is not defined??post_format=
for instance?Is there any other way to view an archive of “undefined” post format posts you can think of?
I could create a Page Template that does the query for
NOT_EXISTS
onpost_format
, but I wish there were a more direct/native way to do this.@volkerforster Thanks for the report — what database table are these WooCommerce fields in?
Forum: Plugins
In reply to: [Autoptimize] Editor on iPhone scroll is brokenHm strange. I had disabled all other plugins and Safari extensions, and switched to the Twenty Twenty-Three theme to test this. The problem only returned when I re-activated Autoptimize.
Forum: Plugins
In reply to: [Autoptimize] Editor on iPhone scroll is brokenI’m using the Gutenberg / block editor
Forum: Plugins
In reply to: [Autoptimize] Editor on iPhone scroll is brokenTurning off the metabox option fixes this
Forum: Everything else WordPress
In reply to: Some Trac RSS feeds appear brokenThis is not an issue with my WordPress install; this is an issue with the WordPress Trac site.
I think this is a Safari issue! I just tried this in Firefox and it worked great. https://github.com/Automattic/wp-calypso/issues/43068
This has been happening to me for a long time, too, on half a dozen sites with all kinds of various setups. Most notably it happens on a site with no activated plugins other than Jetpack. I tried deactivating, uninstalling, and reinstalling with no luck.
Forum: Plugins
In reply to: [wp-Typography] Intelligent character replacement un-texturizes wp_titleWordPress 5.5.1 with a custom theme that doesn’t do anything to
wp_title
, just doesadd_support('title-tag')
andwp_head
Forum: Plugins
In reply to: [wp-Typography] Intelligent character replacement un-texturizes wp_titleSorry, quote replacement doesn’t work in
wp_title
when it’s on, eitherForum: Plugins
In reply to: [wp-Typography] All-caps link titles in Links widget are wrapped in spanAh ok, of course, I had to add it as an action:
add_action( 'wp_loaded', function() { remove_filter( 'link_name', array( WP_Typography::get_instance(), 'process' ), 9999 ); });
Forum: Plugins
In reply to: [wp-Typography] All-caps link titles in Links widget are wrapped in spanThanks, though that doesn’t seem to be working for me.
Forum: Plugins
In reply to: [wp-Typography] All-caps link titles in Links widget are wrapped in spanThanks Pepe. Where would this code go? In my themes functions.php?