luisherranz
Forum Replies Created
-
The way to do it would be by using the
data-wp-router-region
directive from the@wordpress/interactivity-router
package.You just need to mark the parts of the page that you want to update with that directive and then use
actions.navigate
from the router package with the new URL. The Interactivity API will handle changing the HTML, making the minimal changes in the DOM and preserving the state of all components.This means that instead of making an AJAX call to generate the new content, you can generate it directly in the theme or in your block. If you need the content to be variable for the same URL, you can use queries.
Forum: Developing with WordPress
In reply to: Creating user over a fetch API fails due to Empty Password?I’m glad it’s solved ??
Forum: Fixing WordPress
In reply to: Category sorting A to ZAwesome ??
Forum: Fixing WordPress
In reply to: Category sorting A to ZI believe you should be able to do it with something like this:
function sort_dictionary_posts_alphabetically($query) { if (!is_admin() && $query->is_main_query() && is_category('7-dictionary')) { $query->set('orderby', 'title'); $query->set('order', 'ASC'); } } add_action('pre_get_posts', 'sort_dictionary_posts_alphabetically');
Let me know if it works, but I haven’t tested it though, so be careful.
Forum: Developing with WordPress
In reply to: Creating user over a fetch API fails due to Empty Password?That’s strange. How are you authenticating yourself to perform the request? Cookies, basic auth?
Forum: Developing with WordPress
In reply to: Edit Image for Media Library Document?Ohh, gotcha. I don’t think that’s possible. One thing you could do is add the image you want to the description and remove the featured image from the attachments template. That way, users won’t see the auto-generated image, and they’ll see the one you want.
That’s unfortunate. I’d try to contact Blocksy authors, as all themes should work fine with child themes.
Forum: Developing with WordPress
In reply to: Edit Image for Media Library Document?Usually, if you want to replace an image, it’s easier to delete the old one and re-upload the modified image again.
But if what you want is to replace the old image with a new version for some reason, you can also install a plugin that adds that functionality to WordPress: Search Replace Image plugins.
Let me know if that helps.
Forum: Developing with WordPress
In reply to: Having text with the same aspect ratioNo problem!
Oh, no. You need to copy the original
header.php
file and add the breadcrumbs code in the correct place.Forum: Developing with WordPress
In reply to: Having text with the same aspect ratioThere’s an extra space that shouldn’t be there.
Wrong:
font-size: 2.1 em;
Right:
font-size: 2.1em;
That file is usually called
header.php
, but it may vary across themes. If you don’t find it, search for the file that has thewp_head
action.Yes. If you don’t want to modify the block files, you should create a child theme.
Awesome. I’m glad it’s solved now.
Don’t forget to mark the topic as resolved ??
Forum: Developing with WordPress
In reply to: Having text with the same aspect ratioOh, I see. I’m not an expert in CSS, but I think you can use CSS’s viewport-relative units to make the text shrink as the viewport shrinks.
Something like this:
div.textsearch { font-size: 2.1vw; /* Adjusted to be relative to the viewport width */ line-height: 1.2em; min-font-size: 12px; /* Minimum font size */ }
You might need to set it to
2.1em
again on mobile to return to its original size.