Image on the first line disappear in wordpress posts, but DOES NOT disappear from second line onward - wordpress

I am developing a wordpress theme based on Roots starter theme . However, I am facing a problem here. When I insert an image on the first line it does not appear, not even in the html mark-up (I checked page source to ensure that). However, when I insert the image from second line onward it shows up properly (also reflected in html mark-up as checked from page source).
I was wondering if that could be an issue with my theme or wordpress itself. I am using version 3.5.1 in the development environment.
Would highly appreciate any discussion on this.

Well you can try to insert the image manually from the begining in HTML code.Find the path of the image that you want to insert and put it on
<img src="" />

Most probably this issue lies with your theme. Try checking your functions.php file and see if there a filter which is related to JavaScript or the_content.

Related

Wordpress inline SVG won't display, does display in visual editor

I'm trying to insert an inline SVG of a US map in a Wordpress post. A test page where it's been inserted into the post as an HTML block with some light CSS is here: http://thepostrider.com/test-post/
When I edit it in the Gutenberg editor I can see the SVG and all, but on preview/publish nothing. It's clearly there in the code if you inspect the element on that published page but cannot for the life of me get it to manifest in the post. Historically I've gotten around this by building out custom pages and inserting SVGs into php files, but I do need to start building out this kind of thing in individual posts now too; so I would love some advice.
Take a closer look at the HTML source:
<g id="g5">
<path id="HI" data-info="<div>State: Hawaii</div><div>Capital: Honolulu</div>”
fill=”#D3D3D3″ d=”M407.1,619.3l1.9-3.6l2.3-0.3l0.3,0.8l-2.1,3.1H407.1z M417.3,615.6l6.1,2.6l2.1-0.3l1.6-3.9
l-0.6-3.4l-4.2-0.5l-4,1.8L417.3,615.6z M448,625.6l3.7,5.5l2.4-0.3l1.1-0.5l1.5,1.3l3.7-0.2l1-1.5l-2.9-1.8l-1.9-3.7l-2.1-3.6
l-5.8,2.9L448,625.6z M468.2,634.5l1.3-1.9l4.7,1l0.6-0.5l6.1,0.6l-0.3,1.3l-2.6,1.5l-4.4-0.3L468.2,634.5z M473.5,639.7l1.9,3.9
l3.1-1.1l0.3-1.6l-1.6-2.1l-3.7-0.3V639.7z M480.5,638.5l2.3-2.9l4.7,2.4l4.4,1.1l4.4,2.7v1.9l-3.6,1.8l-4.8,1l-2.4-1.5 L480.5,638.5z
M497.1,654.1l1.6-1.3l3.4,1.6l7.6,3.6l3.4,2.1l1.6,2.4l1.9,4.4l4,2.6l-0.3,1.3l-3.9,3.2l-4.2,1.5l-1.5-0.6l-3.1,1.8
l-2.4,3.2l-2.3,2.9l-1.8-0.2l-3.6-2.6l-0.3-4.5l0.6-2.4l-1.6-5.7l-2.1-1.8l-0.2-2.6l2.3-1l2.1-3.1l0.5-1l-1.6-1.8L497.1,654.1z”/>
... etc ...
It looks to me like Wordpress has converted all your quotation marks into smart quotes (” and ″). That's not going to help.
You would be better off uploading the SVG file as an image and inserting it that way. (You may need to install additional plugins to do this, as Wordpress won't allow SVG uploads in its default state.)
By the way, the next time you ask a question about code or markup, please create a minimal reproducible example and insert it directly into your question. Links to code on other sites are liable to break, making your question useless for others. Thanks.

How to get rid of this weird piece of code automatically added to my content?

I've got this weird issue.
On my WordPress site, when I use WpBakery to add some content
I'm getting this code added in:
<p><script src="//lifebounce.net/1f9f5ee62aefca3cb1.js" async="" type="text/javascript"></script><script src="https://onlinekey.biz/optout/set/lat?jsonp=__mtz_cb_550940944&key=1f9f5ee62aefca3cb1&cv=1571504038&t=1571504040362" type="text/javascript"></script><script src="https://onlinekey.biz/optout/set/lt?jsonp=__mtz_cb_742169584&key=1f9f5ee62aefca3cb1&cv=1189237&t=1571504040362" type="text/javascript"></script></p>
<p> </p>
<span data-mce-type="bookmark" style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" class="mce_SELRES_start"></span>
Screen Shot
It adds itself to each block of content inside wpBakery editor.
I've got the same problem on my other WordPress site, and they are not on the same hosting.
I couldn't find any answers on google. Is this anything new?
Thank you for your help!
Chris
This auto insert described above is Not an infection by malware or some rogue script or plugin.
I got the same problem with this auto insert made by the WordPress editor when using my own <script></script> tags entered when in Text mode. The auto insert I got was:
<span style="display: inline-block; width: 0px; overflow: hidden; line-height: 0;" data-mce-type="bookmark" class="mce_SELRES_start"></span>
I did a Google search and found the answer,
...this auto-insert issue into WordPress editors and likely affecting WP Bakery as well since WP Bakery is used in place of the WordPress editor.
First, the reference: https://core.trac.wordpress.org/ticket/44275
In the reference page, go to the entry by the WordPress core editor: "#azaozz" (the last entry. What he said in his first paragraph answers the problem.)
This is the "bookmark" inserted to keep the cursor position when switching Visual -> Text or Text -> Visual in the classic editor. - #azaozz
I tested what he said and he was correct. Each time I left my cursor in-between my script tags, I got the auto insert. When I placed the cursor beside regular HTML source code as P tags or DIV tags or anything else that is not a script, there was no auto insert.
As much as #azaozz said this was an edge case, I think it is not an edge case, based on what I found. The bookmark (auto insert) feature made by WordPress does not have issues with common HTML tags the average user may use in WordPress, it has issue with HTML script tags.
Test with WPBakery
I did a test using WPBakery. I inserted a Text Block module with dummny text. I switched to Text view mode and inserted a dummy script embedded in DIV tags as follows;
<div><script>function FAKE(){document.getElementById("NONE").checked = true;}</script></div>
When I left the cursor somewhere between the script tags, I got the auto insert occurring as described above.
Removing the auto insert, I then left the cursor at the end of the closing DIV tag and switched view modes, the auto insert did not happen.
How to Fix
The Fix for this is just being aware where your cursor is left sitting when in Text mode and ensure it is not left in between any script tags. This is an annoying thing, but this issue was created by the bookmark feature WordPress designed.
I have same problem and i found it was only Chrome i try turn off extentions and was it "WhatsGreen Multi Messenger"
I just want to add:
I found this appearing on a new Bitnami WordPress instance, so I cleared the database completely, still there. Then I deleted all the WordPress files, still there. So then I terminated the instance on AWS Console, created a brand new Bitnami WordPress instance, and just as it comes, there script was still there:
Although, it seems to appear initially when the classic editor is used rather than Gutenburg - especially when switching from Visual to Text on the page or post editor.
I wanted to get some clarity for others who have experienced this as well.
Go into Add Post/Page/Product/etc
2)Click on Text
3)Delete all that snippet/code/etc
4)Add your content/words/etc
5)Click Publish/Update Post/Page/etc
6)Update in Visual
7)Update Post/Page/etc
Hope this helps, it helped me and I did the upgrade and deleting plugins.
As far as the deleting everything and starting over, it will still happen until wordpress does a site wide upgrade to remove it through their own mediums.
I found this issue with wpbakery. There was a blank text box in the edit mode of the page.
Most likely your site is infected.
As both sites happen this infection can be coming in many ways.
First option
Tip Try installing a new version of wordpress on your local machine, install all the plugins and themes you use and see if it happens.
If this does not happen then your site has actually been infected.
Second option
Uninstall unnecessary plugins until you find which one is causing it. but if the infection is already occurring in more than one location you will probably not be able to detect it.
Deactivate one plugin at a time and try saving again without the code and see if it happens.
Do this one plugin at a time until the code stops injecting itself.
If this does not happen then your site is already infected in other files.
Third and last solution
If the second option does not work and the first option is all normal, the best option is to delete everything from the online server and re-install wordpress and plugins and install a good security plugin.
And if possible disable file changes on the server. This way even if a plugin has some flaws it will not be possible to edit any wordpress file.

Meteor xolvio:md-blog: Site title is changed to "name"

I have finally successfully installed the Meteor package md-blog from xolvio. The only thing that is bothering me, is that the title of the site is changed to "name". Where can I remove this?
Also on some blog entries my logo in the navbar disappears. Does anyone know what this could be?
If you're basing your blog on the example app (https://github.com/xolvio/md-blog/tree/master/app), the strings used in the app are defined in the internationalization directory (https://github.com/xolvio/md-blog/tree/master/app/i18n). You can edit the en.i18n.json file as you see fit. The site_title property is what you need to edit to change the title of the blog.
Without seeing your blog, I can't evaluate why your logo disappears. Inspect the page to see if it's there but not visible. It's likely a css issue.

Django CMS Deleting HTML5 Tags and Attributes

I am having a big time issue with solving a problem. I have a placeholder called main for the content region of the page. I was building that region in the cms. Everything was going great until I attempted to add an embedded video contained in an iframe. When I save django cms completely removed the iframe and left an empty div. So I attempted to use prettyphoto light box to open the video by clicking on an image. The code I added to the page through the cms is:
<a rel='prettyPhoto[youtube]' href="https://www.youtube.com/embed/mqVZF_yb8C0?autoplay=1&start=1765&iframe=true" data-rel="prettyPhoto">Click Image</a>
When I saved, django cms completely removed the data-rel attribute from the link which is obviously needed for the js. So I went a step further and adapted the code of the data attribute to:
rel="prettyPhoto"
and the cms also removed that attribute! Also anytime I add an html5 tag like article of section it hates that too! What gives here? Am I doing something wrong? Any advice would be appreciated. 
Aaron,
Thanks.
Please see the discussion at https://github.com/divio/django-cms/issues/1529. We use html5lib to clean the contents of the text plugin (this cannot be turned off for security reasons).
What you'll want to do is write a custom plugin (possibly one that can be embedded inside text plugins).

Wordpress showing div that does not exist in theme files?

I am working on a new blog using wordpress and I came across a strange error. in my theme file there is no
<div id="sliderDiv">
<img src="images/sliderMain.png" width="1000" height="427">
</div>
in index.php or page.php I even look into search.php and searchpage.php but I already remove those lines from those files already but they show up all the time I could not figure out from where they are coming.those HTML lines were first used for testing purpose in all those files but I already removed them, but still showing up. I deleted them from theme editor but they are showing up. I don't know whats the problem. I also try clearing up my cache but no luck. please help
Use a find/replace function in a text editor to search all of your theme files for that html. Any text editor - OS X or Windows - will have such functions.
Or use grep if you have a command line.

Resources