Forums

want to put sidebar in iframe (11 posts)

  1. hirangoly
    Member
    Posted 1 year ago #

    I want to put the whole sidebar into an iframe. I am new to wordpress and php so if anyone can give me the solution or hint then it would be a great help for me.

  2. Edit your theme to call get_sidebar() inside the iframe, I would guess, but why?

  3. hirangoly
    Member
    Posted 1 year ago #

    I want to hide the tags cloud, Archives in the sidebar from the search engine. I thought to hide the complete the whole sidebar within iframe to protect it from search engine.
    Actually i want to hide the sidebar from individual post only not from the main page.
    From where i can edit the theme to call get_sidebar() inside the iframe. Please explain it more clearly

  4. Actually i want to hide the sidebar from individual post only not from the main page.

    Don't use iFrames.

    Use http://wordpress.org/extend/plugins/widget-logic/ and then set the widgets in your sidebar to show up on the front page only (or !is_single() )

  5. hirangoly
    Member
    Posted 1 year ago #

    But i want to hide the sidebar only from search engine not from user. The solution you suggested will hide the sidebar from users also. I want user to use the sidebar.
    Also my company suggetsed to keep the sidebar in iframe so that it is not caught by search engine.
    Please explain me how can i keep complete sidebar in the iframe.

  6. Putting it in an iframe doesn't stop search engines, just FYI. Google will still see the links. If it's on the web, Google will find it.

    From Google:

    IFrames are sometimes used to display content on web pages. Content displayed via iFrames may not be indexed and available to appear in Google's search results. We recommend that you avoid the use of iFrames to display content. If you do include iFrames, make sure to provide additional text-based links to the content they display, so that Googlebot can crawl and index this content.

    Because your TAGS are going to be linked to in your POSTS, Google will still be able to crawl them, which kinda defeats the purpose you've got going here.

    Basic rule: If you don't want Google to see it, don't put it on the web!

    From where i can edit the theme to call get_sidebar() inside the iframe. Please explain it more clearly

    Go into your theme folder and open the .php files. In them (MANY of them), they have calls to get_sidebar() or perhaps include(sidebar.php). You want to take those out and replace them with an iframe call.

    It may be just as simple as this: <iframe src="sidebar.php"></iframe>

    But I cannot even guess if this might work as desired. I know you'll have problems since iframes require you to define the absolute size, which means you'll probably have scrolling issues.

  7. hirangoly
    Member
    Posted 1 year ago #

    i copied this code :
    <?php endif; ?>
    </div>
    </div>
    <?php $url = TEMPLATEPATH.'/sidebar.php' ?>
    <iframe src="<?php $url ?>" </iframe>
    </div>
    <?php get_footer(); ?>
    inplace of :
    <?php endif; ?>
    </div>
    </div>
    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>

    in the index.php (Main Index Template)

    The problem is i am unablt to see anything. The iframe seems blank (white page) without any scroller.

  8. mmm. Try this.

    <?php endif; ?>
    </div>
    </div>
    <iframe src="<?php bloginfo('template_directory'); ?>/sidebar.php"> </iframe>
    </div>

    I saw two problems: One is that TEMPLATEPATH may not be called correctly. The other is that your iframe code was missing a closing >

  9. hirangoly
    Member
    Posted 1 year ago #

    getting this error while using this code:
    Fatal error: Call to undefined function get_search_form() in C:\wamp\www\wordpressflem\wp-content\themes\Flamingo\sidebar.php on line 6

  10. I did say it might have problems, right?

    Because you've got sidebar in an iframe, it's no longer got access to the header, which means it doesn't have access to the WordPress functions.

  11. hirangoly
    Member
    Posted 1 year ago #

    what should i do then to got access within iframe?

Topic Closed

This topic has been closed to new replies.

About this Topic