Resolved

Removing the bloglovin iframe

Ultra Theme started by Tine17 Jul 14, 2017 18 replies
Tine17 Jul 14, 2017 · 11:18 am #7293

Hi there

First of all I am really happy about the ultra theme. A while back I used this code

// Break Out of Frames for WordPress
function break_out_of_frames() {
if (!is_preview()) {
echo “\n\n\n”;
}
}
add_action(‘wp_head’, ‘break_out_of_frames’);

to remove the iframe at bloglovin.com and actually make sure that I recieved the traffic I produced, but then it stopped working after you made an update of the theme. What can I do to get the iframe removal function back again?

Thanks
Tine

Andrew Misplon Puro Jul 15, 2017 · 8:19 am #7296

Hi Tine

Glad to hear you’re enjoying Ultra 🙂

All themes completely overwrite their theme files during updates so if you added that function to a theme file it will be overwritten every time you run a theme update.

Try adding the function using Code Snippets: https://wordpress.org/plugins/code-snippets/

Tine17 Jul 15, 2017 · 9:04 am #7297

I was using another plugin to add the code snippets, but I tried using yours and now I am unable to enter my own page…

Tine17 Jul 15, 2017 · 9:05 am #7298

This reply has been marked as private.

Andrew Misplon Puro Jul 15, 2017 · 9:11 am #7299

If you were using another snippets plugin then updating Ultra shouldn’t have any influence on the snippet being present or removed.

Andrew Misplon Puro Jul 15, 2017 · 9:13 am #7300

So one option now is to just delete Code Snippets. Go to /wp-content/plugins/ on your server and delete the plugin.

There is a Code Snippets recovery mode, I’m looking for it now, you can also try Googling it if you want. It’s a variable you insert into your wp-config.php file.

Tine17 Jul 15, 2017 · 9:16 am #7301

I am unable to go to /wp-content/plugins – all I get is a white screen and I am also unable to go to /wp-config

Andrew Misplon Puro Jul 15, 2017 · 9:17 am #7302

Here we go:

define( 'CODE_SNIPPETS_SAFE_MODE', true );

Insert that into your wp-config.php file which is located in your WordPress root directory on your server. Insert this line right after:

define( 'WP_DEBUG', false );

That’ll let you back in so you can go and inspect what the issue is with your snippet. You should ideally also only run this snippet on the front end. When you save the snippet you can choose to run the snippet on the site front end only.

Andrew Misplon Puro Jul 15, 2017 · 9:18 am #7303

Thanks for your reply. Please, keep private replies for sending passwords etc. Thanks.

/wp-content/plugins is a location on your server. You’ll need to use a hosting file manager or FTP program to access.

Andrew Misplon Puro Jul 15, 2017 · 9:21 am #7304

So step one: access your server via FTP or hosting file manager. Step two: download wp-config.php to your desktop. Step three: edit that file and insert:

define( 'CODE_SNIPPETS_SAFE_MODE', true );

just below this constant:

define( 'WP_DEBUG', false );

You’ll now have access. Then, you need to go and edit your function, there is an error that’s causing WP to fail.

Andrew Misplon Puro Jul 15, 2017 · 9:26 am #7305

OR if it’s easier for you, go to /wp-content/plugins on your server and delete the code-snippets folder. That’ll put you back to where you started.

Tine17 Jul 15, 2017 · 9:41 am #7306

Ah, I didn’t think of accessing my server. That helped, but I am still unable to remove the bloglovin iframe and I would prefer to get the traffic and not giving it to bloglovin

Tine17 Jul 15, 2017 · 9:51 am #7308

Well, that will only remove the frame when I read any blogs from bloglovin. I would like to make some sort of redirection to my blog so it will happened automatical for those who click on my bloglovin feed. I have used the snip mentioned in the beginning, but a few updates ago it stopped working. Have you made anything that blocks for that kind of snip?

My theme says markups are not allowed…

Andrew Misplon Puro Jul 15, 2017 · 9:56 am #7309

WordPress themes don’t usually delve into those areas, blocking functions etc. It’s very easy to test theme involvement, go to Appearance > Themes and switch to a default WordPress theme, does the issue persist? Recent updates to Ultra have all been minor.

Andrew Misplon Puro Jul 15, 2017 · 10:00 am #7312

Diving into this function is a bit beyond the support we usually do here but for what it’s worth, here is the function:

function break_out_of_frames() {
	if ( ! is_preview() ) {
		echo "\n\n\n";
	}
}
add_action( 'wp_head', 'break_out_of_frames' );

And here is me running it locally without issue in Code Snippets, notice how I’m only running it on the site front-end:

If you deleted Code Snippets and want to use it again, reinstall it, if you site crashes you’ll need to follow my steps above to put Code Snippets into safe mode so you can delete the function and start over.

19 posts