7

Disabling the sitemap is easy, just add this line to your functions.php: add_filter( 'wp_sitemaps_enabled', '__return_false' ); Removing specific posts goes like this: add_filter( 'wp_sitemaps_posts_query_args', function( $args, $post_type ) { if ( 'post' !== $post_type ) { return $args; } $args['post__not_in'] =...


6

https://wordpress.org/support/topic/remove-inline-styles-5/ add_action( 'wp_enqueue_scripts', function() { $styles = wp_styles(); $styles->add_data( 'twentytwenty-style', 'after', array() ); }, 20 );


3

Use the render_block filter hook: add_filter( 'render_block', 'wrap_my_gallery_block', 10, 2 ); function wrap_my_gallery_block( $block_content, $block ) { if ( 'core/gallery' !== $block['blockName'] ) { return $block_content; } $return = 'my-gallery-block<div class="my-gallery-block">'; $return .= $block_content; ...


3

This is not possible, require is a PHP language construct, it's not a WordPress function, and can't be filtered or overriden via WordPress APIs These are your options: If the functionality you want to remove is implemented via actions and filters then: Unhook the things you don't want from that file Add new hooks that happen after them that attempt to ...


3

You can merge palettes $existing = get_theme_support( 'editor-color-palette' ); $new = array_merge( $existing[0], array( array( 'name' => __( 'Strong magenta', 'themeLangDomain' ), 'slug' => 'strong-magenta', 'color' => '#a156b4', ), array( 'name' => __( 'Light grayish magenta', 'themeLangDomain' ), ...


3

Okay, it appears that I was overwhelmed by the amount of functions for translating strings. The functions with an 'x' in their name need a gettext context. I don't have that for my strings, so it didn't work. esc_html_x(); replaced with esc_html__(); and _x(); replaced with __(); is the simple solution. Embarrassing for me, hopefully helpful for someone ...


3

You are trying to translate a string with a context but in your po file your string doesn't declare a context To declare a context in your po file you need to use msgctxt msgctxt "permalink title" msgid "%1$s by %2$s" msgstr "%1$s von %2$s" You can find more documentation on how to format your PO file here (It's very simple, there is only 5 different ...


2

Follow up on @jmarceli's great answer to target specific menu locations function squarecandy_menu_admin_limit_depth( $hook ) { if ( 'nav-menus.php' !== $hook ) { return; } wp_enqueue_script( 'squarecandy-admin-menu-depth', get_stylesheet_directory_uri() . '/js/admin-menu-depth.js', array(), '1.0.0', true ); } add_action( 'admin_enqueue_scripts', '...


2

Yes, you can disable auto update by adding this line of code in your wp-config.php file: define( 'WP_AUTO_UPDATE_CORE', false ); OR Disable automatic WordPress theme updates by adding the following filters in your functions.php add_filter( 'auto_update_theme', '__return_false' );


2

It doesn't look like you've built a full theme yourself from what you've posted so perhaps you could add more information to your question. But, I think you should start by having a read here to check that you're doing it correctly: https://codex.wordpress.org/Theme_Development then post back again if you're still having problems. Then copy the existing ...


2

You also need to create header.php, sidebar.php, footer.php for custom theme.


2

The get_the_author can directly be used to display the name of the author. There are few settings to be done on the admin for this: Under the user settings add make sure you have the first and last name fields filled up. After that see for the Display name publicly as options and select whichever format you want the name to be shown. Click save and refresh ...


2

The problem is that, you have added extra white space before wp_ajax action. remove space from actions ' wp_ajax_my_action' and ' wp_ajax_nopriv_my_action'. because of extra space before ajax request, showing the 400 bad request error. You should use : add_action('wp_ajax_my_action', 'my_action'); add_action('wp_ajax_nopriv_my_action', 'my_action');


2

This seems to have done the trick: // Display our list of font options $allowed_html = array( 'option' => array( 'value' => array(), 'selected' => array() ), ); echo wp_kses($fontListStr, $allowed_html);


2

in your theme folder. create a new php file. For example call it: landingpage.php in the php file you could have something as basic as: <?php /* Template Name: Landing Page */ get_header(); while ( have_posts() ) : the_post(); the_content(); endwhile; get_footer(); ?> Elementor will be called / inserted where it says the_content(); ...


2

The file needs a template header and will only behave as a user-selectable custom page template. True special templates like page-$slug.php that match the post's slug will only work when they live in the root theme directory.


2

You can modify the request by adding the orderby parameter: modified $args = [ 'orderby' => 'modified', 'order' => 'DESC', ]; $query = new WP_Query( $args ); WP_query Order & Orderby Parameters


2

Your analysis of the problem is absolutely right. By having separate autoloaders in the theme and plugin you'll run into conflicts and only the first one being loaded. There is no easy and general solution to this, but if you control the whole stack the best solution probably is to put the whole site including WP under composer management and define the ...


2

function wp_dequeue_kirki_style() { wp_dequeue_style('kirki-styles'); } add_action('wp_enqueue_scripts', 'wp_dequeue_kirki_style'); Please make sure that you have handler name kirki-styles in the parent theme for the css file that you want to remove. Because wp_dequeue_style function used handler as parameter. You can check documentaion of dequeue ...


2

Use wp_get_attachment_image_src to get the image properties and URL: $logo = get_theme_mod( 'custom_logo' ); $image = wp_get_attachment_image_src( $logo , 'full' ); $image_url = $image[0]; $image_width = $image[1]; $image_height = $image[2]; Edit: Adding more information based on your comment. The URL it points to is simply made with home_url: esc_url( ...


2

Building on the answer from Aristeides, here is a complete working code example of using the theme_mod_acccent_accessible_colours filter. This is tested and working in version 1.1 of TwentyTwenty and version 5.3.2 of WordPress. You can place this code in your functions.php file and change the colours in the array to what you'd like. In the code shown below ...


2

Your menu name is not consistent. When you created the menu, you named it 'header-menu'. But when you rendered it, you tried to render 'top-menu'. 'top-menu' doesn't exist; it needs to also say 'header-menu'.


2

is_single() and is_singular() are not the correct functions to use here. Your comment mentions that this is being added to search.php, but is_single() and is_singular() will always be false on search.php, because those functions are checking if the current page is a single post or page, but search.php is not. It's is a list of multiple results. is_single() ...


2

The best way would be to expose the data, so it can be modified. You can do this by adding a filter: add_theme_support( 'editor-color-palette', apply_filters( 'themeLangDomain_editor_color_palette_args', array( array( 'name' => __( 'Strong magenta', 'themeLangDomain' ), 'slug' => 'strong-magenta', 'color' => '#a156b4', ...


2

It's because you're skewing the parent container with CSS transforms. You can see in this screen capture of developer tools that the parent cuts off the content on the second row. Try this: .menu-primary-menu-container{margin-right:10px;} You'll see that fixes it, so you just play around with those settings and get it exactly how you want it. Here's what ...


2

WordPress always queries a default set of posts when you view any sort of archive. So if you run your own query as described you’ll end up with 3 database queries instead of 1. You should not develop your template the way you describe. The standard WordPress templates should all use the default query. You’ll be coming back as the 400th person to ask why ...


2

You can't just redeclare the function in the child theme or call add_action a second time. It doesn't replace it, it adds a second hook. As a result, you haven't overriden it, you've duplicated the original. Child theme overrides only work for templates. What's more, by adding a second definition of wp_bootstrap_starter_custom_header_setup you've declared ...


2

WordPress is a whole package of different code components working together to provide a functional Content Management System. WordPress Core, Plugins, and Themes are all part of this package. Since some of these components update separately you do not want to edit the code directly, otherwise your changes will be overwritten whenever these components update. ...


2

As per my understanding of what you need, you want to create page templates. Page templates are a specific type of template file that can be applied to a specific page or groups of pages, you can apply a custom design to different page templates as per your requirement. You can read more about page templates here: - https://developer.wordpress.org/themes/...


2

First of all there is no easy way to convert a design from figma to a wordpress theme. After the documentation/ blog you can not export your design as HTML, which means you have to build the basic HTML structur by your self. The only thing what you can export are the styles (css rules) and the pictures. Once you have built the HTML document, you must "...


Only top voted, non community-wiki answers of a minimum length are eligible