I am new to WordPress but have many years of experience in other languages and platforms.
I am trying to center a picture on the page as well as the text. They center fine in the editor when I am creating the page but when I try to view the page everything is Left justified. Same thing if I try to right justify them.
Not sure what happened but now everything is centering correctly.
Now that I have centered the picture, however, I can’t seem to uncenter it. Text works fine, however.
When I select the image and then select the left justify icon, the icon shows selected but it also leaves the center icon showing selected so that both are showing selected. When I preview the page or look at it in a browser, it image is still centered.
This does not happen with text, however. If I select the left justify icon, the center icon shows as unselected and vice versa. Just not with the image.
I then put another image in the first image place and the alignments worked correctly. But when I put back the first image it worked and then it didn’t.
I now have the image in the page and going from left to center alignment and back again and it stays at the left alignment.
It now shows in the editor as centered in both the alignment button and the picture itself.
I can see the page now, but I’m not sure which editor you’re using. Is it the classic editor? Because with blocks, the source code would look a little different.
This is related to the fact that you are using a modern block theme but the classic editor for content entry. In this case, the theme apparently does not provide some styling properties, such as centering.
You have two options:
Add the missing CSS properties yourself. To center the image, for example, you would need to add:
.aligncenter { margin: 0 auto; display: block; }
Or switch to a classic theme such as TwentyTwentyOne.
Unfortunately, I don’t know which “other” editor you mean. WordPress comes with the block editor and the classic editor, and you have to choose one of them to enter your content. The classic editor has fewer options and possibilities than the block editor, but every editor has to find out for themselves which one they are more comfortable with. In addition, there are a large number of other editors available as plugins, mostly connected to page builders such as Elementor or Divi. Each one is different in terms of how it is used and how it behaves. In your case, it is just the combination of the classic editor with a block theme that is unfavorable, and I have described the options for solving this above.
You can switch from the classic editor to the block editor, but not necessarily back (depending on the content you manage there). However, you can try it out at any time by creating a test text in the classic editor and then opening and saving it in the block editor.