Why does my file_exist check fail?

get_template_directory_uri doesn’t return the directory name, it returns the URL of the directory. file_exists needs a file path, not a file URL. Use get_template_directory instead, and don’t forget to check get_stylesheet_directory too for those using child themes

How to update theme to specific version

Is it possible to update the only theme? if yes how should we check the compatibility with current WordPress version we have. Yes, you can manually download a particular version of the theme from .org site. There isn’t a UI for it, but if I take the current twentynineteen download link: https://downloads.wordpress.org/theme/twentynineteen.1.3.zip I can change … Read more

Error when using ‘continue reading’

Without further info I usually check permalink settings when I see 404s where I would expect it should work. Go to WordPress Admin > Settings > Permalinks, just loading the admin page should refresh the settings. Recheck the links that were giving you issues.

Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?

The name you see is the text domain of the theme. __(‘some text’, ‘text-domain’) is a translation function, which makes it possible to translate the some text into different languages. There are also other translation functions that can be used in different situations. You can learn more about translations on the codex, I18n P.s. if … Read more

Change copyright text on the footer section [closed]

It all depends on the theme. Some themes require you to modify one of their files (specifically, the footer.php file, usually) to remove the text. If you go this route, you’d want to create/use a Child Theme so that a theme update doesn’t overwrite your changes. Copy your theme’s footer.php into your Child Theme folder, … Read more

How to put single-***.php in a specific folder?

Changing how WordPress loads files can be very difficult and potentially destroy logic other plugins rely on. Instead, I usually make use of get_template_part() in this case like so single.php <?php get_template_part(‘singles/single’, get_post_type()); And your files like singles/single-foo.php (for CPT foo) singles/single-bar.php (for CPT bar) singles/single.php (this is the default)

Template for landing pages

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(); Included out … Read more

i would like to have 3 default columns editable in guttenberg

So first of all this is explained in detail in the documentation, just not exactly for this particular case. To summarize: You want to set a “block template” for the post type “page”. In this block template you want to have one columns block with 3 column blocks inside with widths of 25%, 50% and … Read more