Add CSS and JS files of the template post on a WordPress page

In your theme’s file functions.php: add_action(‘wp_enqueue_scripts’,’STACK_356524_add_css_js_on_page’,99); function STACK_356524_add_css_js_on_page(){ global $post; if($post->post_type==’page’) { // check if the current wp object is a `page` also is_page() can be used: see https://codex.wordpress.org/Conditional_Tags wp_enqueue_script( ‘js_handler’, ‘url_of_your_script’, array(), ” ); wp_enqueue_style(‘css_handler’,’url_of_your_style’,array(), ‘1.0.0’, ‘all’); } } Up to you adjust the correct path to the .css and .js you need to … Read more

New Page/Post Screen Opens an Existing Post

Turns out that a previously-modified line in the Yoast SEO source code had been reverted, so this error came back in debug.log: 1Uncaught TypeError: Argument 2 passed to WPSEO_Link_Watcher::save_post() must be an instance of WP_Post, null given. Disabling Yoast resolved the New Page/Post error, however I believe the root cause was that the database has … Read more

Split post or page content in two or more columns

If you’re using the Block Editor, use Core’s column blocks. If you’re using the Classic Editor, make shortcodes for Bootstrap’s rows and columns. When you enter content, you can then just enter [row] [column large=”6″]First column content[/column] [column large=”6″]Second column content[/column] [/row] (You may find prebuilt shortcodes out in the wild since this is a … Read more

Create many pages with dynamic content based on 1 template

In case the Multisite functionality of WordPress is an option for you, then that would be the perfect use case for the template functionality of WordPress. You install your template on the multisite, “activate it for all sites” to be used and voilà, it should change on all “networksites”. See the official documentation as a … Read more

How to transfer a site to hosting?

The host often places a default “index.html” file in a public folder such as “www” or “public_html”. It’s often in the same folder as your root WordPress install and its “wp-config.php” file. If you find and delete it, this should let your WordPress install provide the homepage. (One other option in this case is to … Read more

How to change default home link title?

For some reason this code has been added: <h1 class=”entry-title”><?php echo the_title(); ?></h1> the_title will display the current posts title, you should replace this with what you actually want. If you wanted to remove this completely with no replacement just delete this line. Also, this doesn’t appear to be a link at all, just a … Read more