Archive for the 'Wordpress' Category

February 2nd, 2024
11:43 am
WordPress post content has disappeared when trying to edit existing post

Posted under Knowledge Base & Web & Wordpress
Tags , ,

I just hit this when editing a couple of existing posts.

All the post content except the header had disappeared, and I did not seem to be able to recover it. Whilst trying, I did receive an error once about the block format, indicating there was a bug with the block layout additions in WordPress. It is possible that there is also an issue with an existing plugin/plugin version that I am using.

In the end, I discovered a reasonable workaround. When editing the post to update it, click the triple dot menu in the top RHS of the right hand pane. Then select the code editor rather than the visual editor. This revealed all the existing content but in raw code mode.

When I then clicked on the Visual editor again, all of the content came back as originally posted.

I looked for solutions/workarounds online but could not find anything concrete. Whilst this is a nuisance, I can live with the workaround for now, until I can find the time to give more effort to a proper fix/solution.

Comments Off on WordPress post content has disappeared when trying to edit existing post

May 17th, 2022
4:26 pm
PHP Compilation issues with existing Salient wordpress theme

Posted under Knowledge Base & PHP & Wordpress

I hit an issue with the Salient Soft website whereby the PHP error log file used up all my available zen hosting disk space, and my email started to fail. It turned out that there were a number of php define statements in the code, where the actual define name was not quoted. in PHP 7.3, which I was using, this added a warning to the log, stating that this would not be supported in future versions and would fail.

I was surprised that the log had grown suddenly – whilst it did have entries going back a number of years, I suspected that the real culprit was likely a fairly recent server side change e.g. in the php version.

The original incorrect code and the corrected version are shown here for reference:

define (SSW_PHPTHUMB_DIR, “wp-content/phpThumb”);

define (‘SSW_PHPTHUMB_DIR’, “wp-content/phpThumb”);

I must say that it felt strange to have to quote the definition name in addition to the replacement string, but this was correct. In common with others who posted about this online, I elected to use a policy single quotes for the static definition names, and double quotes for other replacement and dynamic strings in the code. I fixed all of these, plus an additional string which should have been quoted in another expression, and everything was fine – all the errors disappeared.

I uploaded a zip of the fixed theme (with a new point version) and unzipped it manually. Whilst initially it appeared that WordPress did not recognise the uploaded theme, this was incorrect – it was actually in the list of themes when uploaded manually and unzipped into the themes directory along with all the others. I did briefly try the wordpress feature whereby you can upload a zip of a new theme and install it using wordpress, but wordpress complained about the writeability of its temporary chosen upload directory so I didn’t pursue this further and just did it all manually, which was fine.

I also hit a number of issues with eclipse for PHP 2022-03, as I had done previously here. My workspace got corrupted somehow causing eclipse errors that would not disappear even with a restart. It also refused to rename a subfolder (which I had renamed with the new theme version) for a while and I could not resolve this and so I had to delete and recreate it and then re-import the theme code from bitbucket. After this, and importing it as a general PHP project as before, it all resolved ok, and as before, I had no trouble importing from git directly into a subfolder of the workspace.

I have been having mouse/mouse driver issues whereby windows keeps interpreting a click as a double click or two successive single clicks which causes numerous issues all over the place, so this may have been partly to blame for php messing up and spitting at me in various ways. However, I do not believe this was the only problem, and am still of the opinion that this version of php has issues – I will keep an eye out for a new version to try, or may even wind back to an older one. I must say that the PHP integration with git/bitbucket did generally work well. Importing from bitbucket with the remote URI was easy, as was all the usual features like creating a new local branch from a newly created remote feature branch in bitbucket, and commiting all the code back, and pulling changes from develop for the final merge (which was done in bitbucket) etc.

After all this everything was fine with the website and theme.

Comments Off on PHP Compilation issues with existing Salient wordpress theme

November 29th, 2015
6:06 pm
Upgrade to WordPress 4.3.1

Posted under Wordpress

This was pretty straightforward, and involved the following:-

  1. Backup the site
  2. Upgraded all widgets/plugins to the latest versions, from within the plugins page in the WP admin.
  3. Perform the upgrade from within the WP admin dashboard
  4. The Folding Categories widget I was using is no longer maintained/compatible so it was removed.
  5. The existing standard archive widget was removed as it is static only and I wanted a collapsible one
  6. I installed the Collapsing Categories Widget – this was done directly by searching from the plugins page and installing automatically. No manual copying of files etc. was needed. The widget was excellent and works well with the existing customised salient theme
  7. I customised the widget as required – key points e.g. for the knowledge base widget were to tick “Expanding shows: Just Sub-categories”, to auto expand the Knowledge Base category, to exclude the Uncategorized and Library categories, and in advanced options to untick “Show top level categories”. The style was set to the default of “Kubrick”.
  8. In addition, I edited the collapsCatStyles.php file from the plugins page for the widget, and changed the rule for “li.collapsing.categories .sym” to use a font size of 1.0em for the arrow pointer as the default of 1.1em was rather too large.
  9. I installed the Collapsing Archives Widget – This is a companion widget very similar to the above Collapsing Archives Widget and with similar settings, also coded by Rob Felty. I used similar settings for this widget, and also edited collapsArchStyles.php, changing the rule for “li.collapsing.archives .sym” to also use a font size of 1.0em as again the default of 1.2em was too large and also different to the Collapsing Categories Widget.
  10. I had to re-enable the existing Flexi pages widget – it was not broken but for some reason the upgrade disabled it.
  11. Finally took a post backup of the site again.

I also performed exactly the same steps on the site for 2intandem.net which uses the same theme etc.

No Comments »

November 14th, 2011
3:29 pm
Using jQuery/ThemeRoller based themes with WordPress

Posted under Wordpress
Tags , , , , ,

It appears that there are widgets and themes which do this, and which allow dynamic theme switching of the jQuery themes. The attraction of this is that it would allow closer integration of the look and feel when using a JSF/Primefaces Java based web app called from an enclosing WordPress based site. One interesting possibility would be to tie the theme selection used for the WordPress site in with the theme selection for the Primefaces based web app.

This will need more investigation but as a starter here are a few interesting links found from initial searches :-

No Comments »