bcworkz
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Prevent WordPress 6.9 move styles to headerThe current style enqueue scheme has no provision to defer style loading. To do so, you’d need to work outside of the enqueue scheme. You could hook the “wp_footer” action and output any desired style blocks or link references you desire. Of course you’d then need to manage any precedence yourself.
As you may know, enqueued scripts currently have a provision to defer loading, but not styles.
If you’d like to see a more formal way to do so within the core style enqueue scheme, you could post an enhancement request ticket in the WP Trac system. Please first search existing tickets to ensure there’s not already an existing similar ticket
Forum: Fixing WordPress
In reply to: wordpress tables missingYou’ll need the phpMyAdmin app in order to hopefully resolve this. It’s generally accessed through your hosting account or cPanel. It allows you to directly view and manipulate the DB.
If this is a new installation, drop all tables with the wp_kv9a6brmkv_ prefix. Any data you may have added will be lost. Then reinstall WordPress.
If this is not a new installation, verify that the tables are actually missing. It’s possible they exist but the DB user that WP is using has no permission to access them. The tables’ assigned permissions will need to be corrected.
If they are truly missing, yet other WP tables such as posts, terms, etc. still exist, your DB has become seriously corrupted and the rest of the DB may not be reliable. It’d be best to drop everything (but first backup what you have now, just on principle), then restore from a known good backup.
If you don’t have a good backup, you could attempt to patch up the existing DB. Alter the table prefix in the wp-config.php file, then reinstall WP. Rename the new options and postmeta tables using the needed wp_kv9a6brmkv_ prefix. You may drop the remaining new tables. Restore the table prefix in wp-config.php back to what it was. You should regain basic functionality this way, but all of your media uploads (attachment posts) will be lacking crucial information. You’ll need to delete all existing media and re-upload it. This will likely break all the media URLs that exist in your posts. You’ll need to also correct all such URLs. Despite all this effort, it’s possible your site will still not work correctly. We cannot know what else might be wrong with the DB aside from missing tables.
Escaping is still the right thing to do even if it doesn’t resolve the issue 🙂
Your invalid character encodes as 0xFFFF, assuming it copy/pasted correctly. I’m pretty sure that really is an invalid UTF-8 character code. So what is it doing in your content in the first place? Would you consider replacing it in your database? You could use the Better Search and Replace plugin to find all instances and replace it with a proper UTF-8 character.
It looks like it was supposed to be some other letter (maybe with a diacritic) that somehow got improperly encoded. Does it occur in place of a specific letter? Or is it replacing a variety of different letters? If a variety, you may need to manually replace them with the right letters.
And if it can be replaced, you might need to consider how it got there and take steps to ensure it doesn’t happen again.
You should be escaping any content prior to output. Run
$descripcion1through esc_xml().By truncating the field to the first 600 chars, there could be HTML tags that fail to properly close, which could cause XML issues. There’s no simple, elegant way to make sure everything closes correctly. The brute force way to ensure there are no improper HTML blocks is to simply strip out all HTML tags so only plain text remains. This is what the WP auto-excerpt function does.
Forum: Fixing WordPress
In reply to: Post Migration Issue192.168.1.190/wordpress should at least work, even if it’s not what you want. By requesting only 192.168.1.190, can you access whatever lies in the default root directory (usually at /var/www/html)? It’s feasible to use rewrite rules to redirect requests to 192.168.1.190/wordpress/ when just 192.168.1.190 is requested. No need to mess with virtual hosts. See this doc page. This assumes Apache web server. If you’re using nginx, there’s a different kind of file that’s equivalent to .htaccess that would need to be altered.
Forum: Fixing WordPress
In reply to: Post Migration IssueConfiguration varies somewhat depending on the specific O/S. I believe Pi OS is essentially Debian?
If so, it uses a virtual host scheme. Generic instructions here.
Where the example has
<VirtualHost *:80>, replace the*with the actual IP address you’re using. If you’re not using port 80, change the80to the correct port.I think the only entries you really need is an arbitrary server name and the DocumentRoot entry. Though you should want the log files enabled as well. Be sure your DocumentRoot value reflects the actual path on your server.
Forum: Fixing WordPress
In reply to: Differnet sections in websiteYou can alter background color of any HTML element by targeting its attributes with custom CSS. The ability to do so with categories depends on whether your theme outputs category class values for appropriate elements. If your theme doesn’t already do so, you could make it so since you’ve created a custom child theme. It’d be a matter of altering the appropriate template files.
Your theme appears to already distinguishes child pages from parent pages with the body class
page-parent, so you could target such pages with something like:
.page-parent { background-color: lightgreen; }Of course, child elements might still maintain their own colors, but those could similarly be targeted. For example:
.page-parent #wrapper { background-color: lightgreen; }Since you’re able to alter theme templates, you can pretty much do whatever you want with layout and colors.
Forum: Fixing WordPress
In reply to: Critical ErrorEnabling debugging is a good tip. Adding to that thought: for production sites, you shouldn’t leave debugging turned on for extended periods of time. Being able to see error messages not only helps you get to the root of the problem, it also can help hackers better exploit any vulnerability they might be trying to exploit.
Forum: Networking WordPress
In reply to: Self install WordPress Multisite vs. paid WordPress hostingIf you have some basic web server administration experience (mainly in using FTP), there’s little to gain from WordPress specific hosting. All it does is save you the trouble of installing WP yourself, which is a very simple task for those with a modicum of experience.
wordpress.com offers good plans and service, but if you’re happy with your current host, I see little reason to switch.
Your choice may come down to whether to use multi–site or a number of individual WP installations. If your sites are low trafficked, it probably makes little difference. Multi-site does have some quirks I’d just as soon avoid. My personal rule of thumb is individual installations are fine for 2-4 sites. For more than that, the multi-site starts to make more sense. But truth be told, for minimal sites, you could probably have a dozen individual sites on a shared hosting plan with little downside.
Forum: Fixing WordPress
In reply to: Critical ErrorDoesn’t the email tell you what the actual error was? What was actual the error then? If it’s not in the email or you didn’t get the email, check your server;s error log for the actual error message.
Once the error is known, the next step is to deactivate the theme or plugin responsible. This can be done without accessing the WP admin area by using FTP to rename the directory of the module responsible for the error. You should then be able to log into your site again. You may then restore the proper directory name, but do not re-activate the related module. Seek assistance through the dedicated support channel of the problem module to help you resolve the error.
Sometimes the error message is too vague to identify a specific module. To regain basic functionality, via FTP, rename your current theme’s directory and also rename the /plugins/ directory to deactivate all plugins. After logging in, restore the proper directory names. Then install and activate the Health Check & Troubleshooting plugin. Activate the plugin’s Troubleshooting mode. Use its troubleshooting admin bar item to selectively activate the various modules in order to identify the source of the error.
Forum: Developing with WordPress
In reply to: collating variables from a wp database into a stringIf you attempted to output
$cloud9, such as output to the console log, it very well may just say “Array”. That’s fine and is expected. Once$cloud9is imploded and and assigned to$liste, then you should get a comma separated list of values.Forum: Fixing WordPress
In reply to: How to Overlap Images?if you’re adding it directly to a block it can cause issues
Indeed. The block editor is very particular about what block attributes are permitted.
You should be able to use the code editor to add an inline
<style>HTML element with appropriate CSS code. Alternately, add the CSS to the Additional CSS section of the customizer (classic theme) or style book (block theme). The Additional CSS section is output for all posts and pages. To target a specific page, look at the post’s<body>tag class attribute values. It’s theme dependent, but there is usually a class such aspostid-1234you can use to target a specific page.In case you haven’t discovered it yet, check out your browser’s element inspector tool that’s part of its developer tool set. To get to it in most browsers, right-click the image and select the “Inspect” option. With the tool, you can edit, add, or remove CSS and immediately see the effect on the page. Changes in the tool do not persist. Once you have arrived at desirable CSS, copy/paste it to an inline style or Additional CSS section. An added benefit — when you’re adding CSS in the tool, it’ll auto-suggest CSS code that’s possible to use.
Forum: Fixing WordPress
In reply to: How to Overlap Images?Use CSS
marginproperties to move one image into the desired position from where the browser would normally place it. Negative distances are allowed with margins, but not padding. You don’t necessarily need to alterz-index, the second occurring image will appear over the other. If the move completely overlays the first image, the first image will be totally obscured unless you set a partialopacityvalue to the top image.Alternately, you could set
position: relative;and usetopandleftto move the image, but this will leave a “hole” where the image used to reside. Subsequent content doesn’t move to fill the hole. When you use themarginapproach, subsequent content moves to fill the hole.Depending upon your overall layout goals, one approach will make more sense than the other.
- This reply was modified 1 week, 5 days ago by bcworkz. Reason: added comment about negative distances
Forum: Fixing WordPress
In reply to: All blogs are gone!If you’re unable to re-activate your normal theme, then it’s definitely causing errors. Not only by corrupting an archive query, but it also has some fatal error that prevents it from being activated.
Check your error log to determine what error is preventing it from being activated. Relay this information to your theme’s dedicated support channel so the theme authors can make appropriate corrections.
If you know something about PHP programming, you might be able to patch the error yourself, though the theme authors still ought to be notified so the problem can be fixed for other users.
Getting the theme activated again may not resolve the original corrupted query problem. There are numerous ways a theme can corrupt queries, but most commonly the “pre_get_posts” action is involved. Search your theme’s files for any
add_action()call involving “pre_get_posts”. Once found, make that line into a PHP comment (add//at the head of the line). That should prevent it from altering the query. There could be other undesired side effects in doing so, but if it resolves the archive query issue then we know where more attention needs to be focused.Forum: Fixing WordPress
In reply to: All blogs are gone!Those pages are always populated with lots of posts every time I tried. I’ve disabled my browser cache, so the content is always coming from your server. Whether that is cached or not, I cannot say.
You’ve either fixed the problem or it is an intermittent problem that’s not revealing itself to me. Based upon the screenshots you provided, it looks like the query has failed for some reason. Try using the Query Monitor plugin to check the main query the next time you fail to get the expected results. Something about the query is preventing the correct results from being returned. What that something is will be a good clue towards the root cause of the problem.