Jonathan Bossenger
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: File Name for Date Archive Block TemplateHi @fredhead yup, understood. I just needed to confirm that you were using a custom query object for your template file. To give you a TL;DR, it is possible, but the solution is a bit hacky and probably not worth the effort if you’re already using a traditional WP_Query object.
If you have a look at the archive template for Twenty Twenty Two, you’ll see that it uses a core/query block, as well as a core/post-template block.
https://themes.trac.wordpress.org/browser/twentytwentytwo/1.1/templates/archive.html
The query block sets up the WP_Query object, and the post-template block is the one that handles rendering the data from the query, similar to how you would set up The Loop in a classic theme template.
At the moment, there is no way to pass the variables from the url to the query block in the template. However, what might be possible is to filter either the query block’s settings and change the query settings, or filter the post-template blocks settings and change the render_callback setting.
In order to do this, you’ll need to use the block_type_metadata_settings filter to get the $settings of the block, based on it’s name from the block $metadata
function my_filter_block_type_metadata( $settings, $metadata ) { if ( 'core/query' === $metadata['name'] ) { // do things for the query } if ( 'core/post-template' === $metadata['name'] ) { // do things for the post-template } return $settings; } add_filter( 'block_type_metadata_settings', 'my_filter_block_type_metadata', 10, 2 );Then you should be able to either alter the query settings, or alter the post-template render_callback to your own callback. Currently the post-template render_callback function is in the wp-includes/blocks/post-template.php file and the render_block_core_post_template function.
Eventually I could see that the query block would be updated to be able to handle processing query vars from the URL, but it’s not currently available.
Forum: Fixing WordPress
In reply to: 5.9 custom global css in block themeHi @rand
I do think that is the eventual goal, but it’s not possible just yet.
If your question has been answered, we would love if you would mark this topic as resolved in the sidebar. This helps our volunteers find the topics that still need attention and more people will get helped, possibly like you did.
- This reply was modified 4 years ago by Jonathan Bossenger.
Forum: Fixing WordPress
In reply to: Gallery Image Link Not WorkingAh, yes, my apologies.
Can you ask you to try something? Create a new blog post for the Wine Review: Sagrantino from Italy & Chile post, and change the slug to sagrantino-2, then use that link in the image, and see if that works.
Forum: Fixing WordPress
In reply to: Disable “auto embed” feature when pasting text and linksThanks @mathse
If your question has been answered, we would love if you would mark this topic as resolved in the sidebar. This helps our volunteers find the topics that still need attention and more people will get helped, possibly like you did.
Forum: Fixing WordPress
In reply to: How to Reduce Space Below MenuThere are typically two ways to add custom CSS to a theme, through a child theme, or via the Customizer.
Using a child theme is generally the recommended way, as you can add any theme customisations to the child theme, either for layout and styling, or custom functionality.
You can read more about how to create a child theme here https://developer.wordpress.org/themes/advanced-topics/child-themes/
Once you have created the child theme, you may need to set the custom padding for the three different places that padding is being applied in the parent theme.
@media only screen and (min-width: 85.375em) .site-content>.wrapper, #featured-slider-section+.site-content>.wrapper { padding: 91px 30px; } @media only screen and (min-width: 64em) .site-content>.wrapper { padding: 61px 30px; } .site-content>.wrapper { padding: 42px 30px; }Forum: Fixing WordPress
In reply to: Fatal error admin-header.php on line 62Hi @draganela
Line 62 contains the PHP variable $post_title, which is being passed to the PHP sprintf function. https://www.php.net/manual/en/function.sprintf.php
Does this happen on all posts, or just a specific post. If it’s on a specific post, can you share the post title here?
Forum: Fixing WordPress
In reply to: error loading pdfHi @avrec
I see from your support thread (https://wordpress.org/support/topic/plugin-conflict-362/) you are using the Tickera ticketing theme. Have you tried contact their support?
Alternatively, have you tried to use one of the default (Twenty*) themes with TranslatePress active, to see if the problem persists. It might be a conflict on the themes side.
Forum: Fixing WordPress
In reply to: Limit the use of the WYSWIG editorHi @alphamike2
This is possible, using the
tiny_mce_before_inithook in a custom plugin or child theme, and only registering the required buttons in the toolbar.https://developer.wordpress.org/reference/hooks/tiny_mce_before_init/
add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' ); function my_mce_before_init_insert_formats( $init_array ) { $init_array['toolbar1'] = 'bullist'; $init_array['toolbar2'] = ''; return $init_array; }The above code will disable all toolbar buttons except the bullet list button.
Forum: Fixing WordPress
In reply to: Gallery Image Link Not WorkingOk, this is helpful. First off I would point out that the ability to edit the Link URL and the rest of those fields is definitely something related to a plugin, and not the default functionality of WordPress. For example, this is what I see on one of my images on a clean WordPress install.
However, your screenshot has given me some info to work with, specifically the URL of the page you want to link the image to, in this case: https://winediplomats.com/sagratino/.
When I try to visit that page in the browser, it shows me a Not Found message, so it looks like that page is not available under that slug
sagratinoon your WordPress site.Are you able to verify that there is a page with that slug?
Forum: Fixing WordPress
In reply to: Multiple selection on filters on category pagesIt looks like you are using the JetWooBuilder plugin for Elementor and WooCommerce which is a commercial plugin.
If you need support for a commercial plugin and need support, please go to their official support channel. In order to be good stewards of the WordPress community, and encourage innovation and progress, we feel it’s important to direct people to those official locations.
I recommend you contact the Crocoblock support desk here: https://support.crocoblock.com/support/home/
Forum volunteers are also not given access to commercial products, so they would not know why your commercial theme or plugin is not working properly. This is one other reason why volunteers forward you to the commercial product’s vendors. The vendors are responsible for supporting their commercial product.
Forum: Fixing WordPress
In reply to: Gutenberg: disable “transform to columns” and “transform to group”Hey @julian_wave
This is generally the right place to ask for support, and then we try and guide you from there.
Similar to your previous support question, are you able to share the code of the custom blocks you are creating? That will give us a better idea of what you are doing, and can make suggestions from there.
Forum: Fixing WordPress
In reply to: Gutenberg editor: modify “change block type or style” textHi @julian_wave
Have you created this block from scratch, or are you extending the existing Heading block in some way?
If you can, are you able to share your custom block code? It’s probably possible to edit that icon overlay text, but it would helpful if you could share what you’re currently doing, to better understand where to change it.
Forum: Fixing WordPress
In reply to: File Name for Date Archive Block TemplateHi @fredhead
Could I confirm with you, are you using a custom instance of WP_Query in your PHP template code to render the issues by month and year? So something like this to filter by post type and date:
$query = new WP_Query( array( 'post_type' => 'issue', 'date_query' => array( array( 'after' => array( 'year' => 2022, 'month' => 4, 'day' => 1, ), 'before' => array( 'year' => 2022, 'month' => 4, 'day' => 31, ), 'inclusive' => true, ), ), ) );`
- This reply was modified 4 years ago by Jonathan Bossenger.
Hi @openbayou
I see you have reference to
acf-fieldin your code, are you using ACF Blocks?If you are, I recommend asking at https://support.advancedcustomfields.com/ so the plugin’s developers and support community can help you with this.
Forum: Fixing WordPress
In reply to: Disable “auto embed” feature when pasting text and linksHi @mathse the code that I have shared with you is JavaScript code, not PHP. So for example what you can do is put that code in a
script.jsfile in a plugin, and enqueue it in PHP using theenqueue_block_editor_assetshook in PHPBecause of this JavaScript requirement, you won’t be able to add this via an mu-plugin, as mu-plugins can only be single PHP files. You can read more about developing regular plugins here – https://developer.wordpress.org/plugins/