Wordpress showing div that does not exist in theme files? - wordpress

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.

Related

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.

Wordpress editor showing white text

I have a problem with a Wordpress site, the editor is showing the text as white (on a white background) so unless you highlight the text, you can't see it. This is only in the admin section of the site, the front-end doesn't seem to be affected
I have found where the css is changing the text to white ( /wp-includes/css/editor.min.css ):
.js .tmce-active .wp-editor-area{color:#fff}
I have removed this and cleared the cache (even tried a different browser) but it's still showing in the editor.
Also, the 'Visual' and 'Text' buttons don't work.
Any ideas?
I have gone through an disabled each plugin, one at a time but it still is a problem.
Check your javascript console. If you see an error like:
"post.php?post=2840&action=edit:2783 Uncaught ReferenceError: tinymce is not defined"
Then the loading of wp-tinymce.php failing. Because the editor hasn't loaded, it appear as if your text is white, or "invisible" in the editor. This can be worked-around by adding:
define('CONCATENATE_SCRIPTS', false);
(Per Tijmen above, or https://wordpress.stackexchange.com/a/63172/118510)
(I use WP Fastest Cache plugin which has it's own concatenation, so if I use that plugin, then I'm OK skipping the default Wordpress concatenation.)
The root problem, however, is that a request to:
/wp-includes/js/tinymce/wp-tinymce.php?c=1&ver=4506-20170408
Is failing or receiving a 404. This could be due to a security restriction on your hosting or CDN.
Let's start with the obvious: is your Wordpress install completely up-to-date, including all plug-ins, themes etc?
It could help to actively declare the color to be black, instead of simply removing the line of CSS you removed, so:
.js .tmce-active .wp-editor-area{color:#000000}
Alternatively, this issue has been known to be caused by several plugins, such as PS Disable Autoformatting, however that instance was a few years ago. Did you recently install a plug-in? If so, try disabling that plug-in to see if that returns the editor to normal.
If none of this solves the issue, you can also try downloading Wordpress and replacing the /wp-includes/js/tinymce/ folder. Although it's unlikely, it's not impossible that something went wrong during an update or so.
If nothing else works, according to this link, you can open your wp-config.php file and add the following line at the very top after the php opening tag.
define('CONCATENATE_SCRIPTS', false);
I have just fixed this problem and thought it would be worth mentioning this basic check to others. If you are installing another theme or a second theme that installs it's own set of plugins, make sure you don't have any existing plugin composers installed or still activated. This can cause the conflict that makes the text white and the tabs to not work.
For me, I had both CMSMasters Content Composer (From previous theme) and WPBakery Visual Composer (From new theme) installed and active, which gave me this exact issue. I had also tried replacing the tinymce file and adding the extra line to wp-config, but none of these worked. Deactivating CMSMasters Content Composer fixed the white text issue for me.
Go into your account settings and check "Disable the visual editor when writing" ... Now try your page and/or post again. You should have text, not in white, and now you should be able to edit your page. Of course, you won't have a visual editor and that isn't any fun.
I think this eventually is a server problem where there are not enough resources for all the block rendering for both javascript and css. In Chrome, check the 'performance' of the page in developer tools ... it's likely less than 30.
For me, the problem was caused by the way the wordpress editor interacts with vue.js in my plugin's custom admin page.
Specifically, the white-text issue on the editor was caused by being inside of a v-if. There must be some conflict in how v-if renders the content which breaks TinyMCE if it is inside of the v-if.
The fix was as simple as switching to v-show. This causes the TinyMCE to be rendered once on page load and then just hidden as needed. Using v-show causes the editor text and toolbar rendered normally.

Images not appearing in Joomla template

I'm new to Joomla, but I've followed few tutorials. I've created a template for my website, but no images are showing up. Looking to the source, my image references look like:
<img src="/templates/fiziaimages/zdjecieDol.png" />
When they should be looking like:
<img src="/templates/fizia/images/zdjecieDol.png" />
^
fizia/images is the correct directory, so I don't know what causes the backslash to not appear.
in a first time you can use your browser inspector to verify if your images are really found.
If it's ok you can try to put your images in the "image" directory in the root of your website

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

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.

Plone 4.2 - manually editing a diazo theme in order to change the default logo

I have installed a diazo theme for my Plone site. Now I need to change the default logo that is being used. In another question I was instructed to look at the rules.xml and index.html files that come in the theme's directory and to figure out how to change the logo by editing one of those files manually. However, I cannot figure out how to do this. These appear to be the relevant lines from my index.html file:
<div id="portal-header">
<div id="portal-slogan">
<span class="heightImmitator"></span><span>Free Theme for Plone</span>
</div>
<a id="portal-logo" title="Site1" href="/"><span class="heightImmitator"></span><img src="images/logoSchools.gif" alt="" title="" height="71" width="402"></a>
<div id="portal-personaltools-wrapper">
<h5 class="hiddenStructure">Personal tools</h5>
<dl class="actionMenu deactivated" id="portal-personaltools">
<dt id="anon-personalbar"><a style="cursor: pointer;" class="link-overlay" rel="#pb_1" href="/login" id="personaltools-login">Log in</a></dt>
</dl>
</div>
</div>
And these appear to be the relevant lines from my rules.xml file:
<copy css:theme="#portal-logo" css:content="#portal-logo" attributes="href"/>
<copy css:theme="#portal-logo" css:content="#portal-logo" attributes="title"/>
<replace css:content="#portal-logo img" css:theme="#portal-logo img" />
I guess that the "replace" line is telling the theme to replace one logo with another. However, it is not intuitive to me how I should edit these files to find the logo that I have uploaded. Incidentally, the image file that I have uploaded is called nav-home1.png and it is sitting in a directory called site-images which is in my home directory.
If I were you (and taking my comment about where to do this above into account), I'd simply remove the <replace /> rule that's trying to pull Plone's logo in from the content and then edit your index.html to reference your image file directly (at this point, it's all just plain HTML).
Incidentally, you may benefit from reading a bit more about the Diazo rules and what they do, on http://diazo.org/. For a heads-up (even if textual) of what the in-Plone experience will be in Plone 4.3, see http://pypi.python.org/pypi/plone.app.theming.
Martin
My solution was to place my image file in the ~/Plone/buildout-cache/eggs/quintagroup.theme.schools-6.0.10-py2.7.egg/quintagr‌​oup/theme/schools/static/images directory and then comment out the line in rules.xml that tells index.html to replace the image, and then edit index.html so that it loaded my image instead of logoSchools.gif, which was previously indicated. This did the trick, but now my problem is that the theme is getting the sizing information from somewhere else, so the image is far too big. Adjusting the height and width attributes in index.html have no effect.
I would suggest getting the static theme files provided by the theme egg. Then editing and packaging it as a zipped file (Use as guide -> http://pypi.python.org/pypi/plone.app.theming/1.0#packaging-themes). Then you can upload it from the Diazo control panel.
If you want to manipulate the zipped files within Plone, you can go to portal_resources in the ZMI and edit the files there. If you want to distribute the edited files, download it from the Diazo panel.
This is a bit of work for now, but the experience should dramatically change in Plone 4.3 as suggested by optilude.
For help in understanding Xpath, use: http://www.w3schools.com/xpath/default.asp Spend some time on the tutorials. It is really simple to understand.
I uploaded my logo image to the FS. I've got a develop-egg in {ZEOHOME}/src/
So, the image shows up like this:
/usr/local/Plone/zeocluster/src/quintagroup.theme.sunrain/quintagroup/theme/sunrain/static/images/theme_rain/PF-Sig.png
(See buildout tutorial for how to add a develop egg...)
In the theme's ..theme/sunrain/static/index.html file, use a direct reference like this:
<img src="/++theme++quintagroup.theme.sunrain/images/theme_rain/PF-Sig.png" alt="" title="PF Sig Logo" height="150" width="300"/>
The sizing info is right there in the <img.. /> tag.
However, it seems to be important, after making any changes, to go to Plone's Theme Control Panel, and deactivate/reactivate the theme, so that it will re-process the Rules.
I have spent the past six hours trying to change the logo in a fresh Plone 4.2 (OK, I'm a bit rusty!)
Quintagroup just tells me to customize logo.png in the ZMI, but that seems so... 2002 ;-) I spent hours yesterday trying to use the 4.3 theme-TTW feature, only to find that SunRain seems to break when I create a TTW copy.
Since this seems to be a top user request, why is it still so absurdly hard to figure out?
Should this not be a simple "Upload your new Logo Image" in the Themes Control Panel?

Resources