Problem with my code
-
hi. i’m having an issue with my blog. i write, for example, the following code:
- XXXYYY
But when i go back to edit the post the ‘‘ disappear and i have to write them all over again
The blog I need help with is: (visible only to logged in users)
-
Hi @jcesguerra, I’m not sure what 1. XXYYY means. Are you intending to show code on your site, or use formatting as you did here?
For what it’s worth, here’s the allowed code, which should be entered in an HTML block. If you enter it using a regular visual editor block, it might go away.
If you want to actually display the code on your site instead of using it for formatting, you’ll want to use a code block:
-
sorry, i wanted to show the code i wrote but it didn’t appear correctly. what i want to have is a numbered list where the name of the item is in bold and then there is a short explanatory paragraph below, and the the next item on the numbered list agan with a paragraph below. the code i have written is as follows, but i think i have a problem with the <p> and </p> tags
<ol> <li><strong>Cien episodios de la historia económica de Colombia</strong></p>Leí algunas de las primeras 'historias', pero no me gustó. Me pareció poco interesante. Son de hecho demasiado cortas las historias, y no se explica bien el contexto y su importancia.</li></p></p> <li><strong>The call of the wild</strong></p>Me gustó. Divertido de leer. Muy del estilo de 'To build a fire' en cuanto al inglés que usa y los temas que explora.</li></p></p> <li><strong>White Fang</strong></p>Lo empecé a leer como a las 3 de la mañana en la terminal de buses del DF. Un día memorable. ... Al final no me gustó tanto. Es demasiado largo y se pierde un poco el impacto. Lo mejor fue el principio cuando los lobos están persiguiendo la caravana.</li></p></p> </ol> -
Thanks. I understand. Can you send me a link to where this list was attempted? Or a post title? Then I can take a closer look to try and get things fixed up.
-
Sure. Here: https://formerjce.wordpress.com/2018/12/30/libros-2019/ and also here https://formerjce.wordpress.com/2017/12/27/libros-2018/ and here https://formerjce.wordpress.com/2017/12/26/libros-2017/
As you can see, the posts are looking the way i want them to, but if i make an update the code changes and the list messes up. I understand that’s because there are errors in the code, in particular with the <p> tags
-
Yep, that’s the problem. Are you adding the p tags, or are they being added by the editor?
-
i’m adding only closing p tags (i thought only they were needed). i don’t know where to add the opening p tags
-
Ok, don’t add any paragraph tags into the list, that’s the problem. :)
It’s invalid HTML, so the editor is trying to correct it.
Taking a look at these posts, I recommend that instead of building them the way you currently are, try a Heading Block for the bold text https://en.support.wordpress.com/wordpress-editor/blocks/heading-block/ and a Paragraph Block for the content text https://en.support.wordpress.com/wordpress-editor/blocks/paragraph-block/
-
but after the paragraph block, will the next heading block continue with the numbering of the list?
-
- The topic ‘Problem with my code’ is closed to new replies.