Trying to add CPT to menu automatically

This code is pulling in custom posts automatically and setting menu order as it does within the function, so trying to change the order in the menu editor will likely cause an error. To change the order change this line: foreach ( get_posts( ‘post_type=cpt-post-type-here&numberposts=-1’ ) as $post ) { to foreach ( get_posts( ‘post_type=cpt-post-type-here&numberposts=-1&order=ASC’ ) … Read more

Styles not showing up in WordPress site

I usually append a random number to the end of the stylesheet while in development mode, if I upload the file to the production server I manually change the version number like this: // Version – to prevent caching $version = mt_rand(1000, 100000); // $version = 1.0.0.0; // Enqueue CSS function wpb_enqueue_styles() { global $version; … Read more

Changing Theme produced a problem on some pages

The error message you’re encountering in WordPress suggests a notice-level issue in the code, specifically in the exclude_pages.php file of the ‘Exclude Pages’ plugin. This issue seems to be related to PHP’s handling of variables and references. Here’s how you can address it: Understand the Error: The notice is indicating that a variable is being … Read more

Fix count of lines of excerpt block (or any block)

Yes, you can fix the height of a Power Query’s nested excerpt block in WordPress to ensure it is always two lines tall, regardless of the actual length of the excerpt. This can be achieved with CSS. The goal is to set a fixed height that corresponds to the line height of two lines of … Read more

Problem getting anything at all showing on my homepage

It sounds like you’ve taken the correct steps to set a custom page as your homepage in WordPress, but you’re encountering an issue where the expected page isn’t displaying. Let’s troubleshoot this: Check Cache and Plugins: If you’re using caching plugins (like WP Rocket), clear your cache. Sometimes, caching plugins can show an outdated version … Read more