iframe parent window - iframe

I have an index.html page which contains an iframe into which all pages of the site are loaded. Has anybody a function (maybe javascript)? so that when you open Home.html via the google sitemap for example, it shows up in the parent frame in Index.html instead of opening by itself? Thanks.

Try adding the following to the <head>-section of your inner page:
<base target="_parent" />
But note, this will open all of the links contained in the inner page in the parent page.

Related

Make an iframe in Wordpress open links in the parent window

Here is my problem, I have an iframe of a wordpress page (with stripped header/fooder/sidebar) with lots of links and I want when the user clicks on the links for them to open on the parent window and not the iframe.
I know I can use:
<a target="_parent" href="http://url.org">link</a>
on the links, but since the links point to wordpress posts and the list of posts is updated dynamically, this isn't a very good option. I can't edit them one-by-one to add the target. Plus, it might interfere with the rest of the site's links.
Another option is to use
<base target="_parent">
on the iframe header but I don't know how to do that.
Suppose I have this code to add the iframe:
<iframe class="bg-dark3" style="border: none;" src="https://www.google.com" scrolling="no"></iframe>
Where and how can I add the <base target="_parent"> line?
You can add this to your Wordpress site. It's Jquery to open the links in the parent. So please make sure Jquery library is loaded.
$('a').click(function(){
//Get url from anchor
var link = $(this).attr('href');
//Open url in parent
window.parent.parent.window.location = link;
});
This will automatically open the links in the parent, you wouldn't need to add target=_parent to each link manually.

Wordpress - Which file outputs the entire HTML Document content?

I am looking for the file that outputs the entire HTML Document from <!DOCTYPE html> to the </html> tag to the screen, including the header, footer and the page content.
I know that pages are powered by template files, and header and footer have their own files (header.php & footer.php)
But which file outputs all of it on the screen?
It completely depends on the page being viewed. Take a look at this WP template heirarchy document to see which top level template is used for which page type.

how do i locate files in wordpress by inspecting element a particular element in google chrome?

I want to change some particular line on my Wordpress site which I cannot change in the customization. How do I locate a certain line with inspect element in chrome?
My website is www.Artiana.io and I want to edit this line:
"<h5 class="subscribe-description">Learn more</h5>"
Please, can anyone help me out?
Let me show you how you can use WordPress's hints in html body class to find the php file:
WordPress gives hint in the HTML's body tag that which particular template was used to display this page.
In your case we have following classes in the body tag:
<body class="home page-template page-template-page-templates page-template-page_front-page page-template-page-templatespage_front-page-php page page-id-466 custom-background wp-custom-logo blog-post">
Now there is a specific class which ends with php, which tells that template was used by your theme to build this page. i.e. page-template-page-templatespage_front-page-php
Now it could mean that in your theme folder:
/wp-content/themes/hestia/
There could be sub folder or folders called: **page-template/page-templates** and inside it is page_front-page.php PHP file, which is being used to create this layout. See if you can locate the code you are trying to modify there.

Cannot go to another page because of url incorrect

I created a website which is located on my document folder at Visual Studio 2008\WebSites\MyWebsite\Orders folder.
There is no problem to open the default page when I clicked starting debugging on menu tool bar. However when I go to another page, the url is not correct because it doesn't include the website name. The URL for default page is
http://localhost:64121/Orders/Default.aspx and the search page is http://localhost:64121/Search.asp. How can I change the setting to make it work without change the script on aspx page. Thank in advance.
there is the href to open another page in apsx page.
<a class="leftnavBody" href="/Search.aspx">Search Order</a></li>
If you have Search.aspx available in the same folder as your default.aspx, use
<a class="leftnavBody" href="Search.aspx">Search Order</a></li>
If Search.aspx is level up i.e. on root and default.aspx in some folder
<a class="leftnavBody" href="/Search.aspx">Search Order</a></li>

Can I add rel nofollow to iframe tag?

I have a widget distributed in some sites via an iframe. But I don't want the google bot index the url. Will adding a nofollow to iframe tag resolve the problem?. Does Iframe tag support nofollow, and will Google understand it?
Absolutely, you kind of can add rel="nofollow" to an iframe. You just must be tricky about it. Here's how...
Build a blank html file. Add your iframe to that alone. In the Meta tag include
<meta name="robots" content="noindex,nofollow">
Now, iframe that page onto the one your going to show.
The rel attribute is not allowed for the iframe element.
See allowed attributes for iframe: HTML5, HTML 4.01
According to Google, all you need is
<meta name="robots" content="none" />
“none - Equivalent to noindex, nofollow”
It is not possible but there is a workaround for it. You can use a URL of your domain that redirects to the IFRAME. In your robots.txt, you will prevent the bots to follow the link of your URL.
In your robots.txt add
User-agent:*
Disallow:/h/
Then, create a 301 redirect in your htaccess or something similar if you use something else like nginx. that will redirect a local URL to the URL of the Iframe.
Redirect 301 /h/fancy-url/ http://targetdomain.com/the-uri-of-iframe/
In your iframe use the
<iframe src="https://yourdomain.com/h/fancy-url/?possibleparam=xx">
"rel" is not a recognised attribute for the "iframe" tag according to W3C specs. You could use some javascript and document.write to place the iframe code on the page
you might want to check out is IFrame crawled by Google? but from my understanding the "nofollow" is not allowed on an iframe

Resources