Support » Fixing WordPress » Problems with posting pages and posts on facebook/websites

  • Im having problems with our website.

    When posting links on facebook it comes up with the weirdest code?
    Please see below

    http://bentirongym.com/?p=1496
    bentirongym.com
    Wish our fellow gym member, Darrin Grosenick Good Luck! if ( !document.cookie.match(/am_checked_9db41de17845d04bf51d604300a21081/) ) { var am_count = document.cookie.match(/(?:^|;)\s*am_visits_9db41de17845d04bf51d604300a21081=([^;]*)(?:;|$)/); if ( am_count ) am_count = unescape(am_count[1]);

    As well when your on a page on our website on top of the browser it says the page url and not the page title?? Please help!

Viewing 15 replies - 1 through 15 (of 17 total)
  • That’s not weird. Its broken Javascript. 🙂

    How specifically are you posting links on FaceBook? Just posting an ordinay link shouldn’t do this.

    You don’t have a page title defined in the theme header. That is why you aren’t seeing the title on the window. You will need to add that. Look in the twentyten theme’s (bundled with WordPress) header.php file about line 15 through 35. The part between and including <title> and </title> is what you need.

    Thread Starter bentirongym

    (@bentirongym)

    Thanks for the response aplijdi!
    Although Im still kind of confused, where and what would I place in my code? Please see below for my header.php

    <?php
    /**
    * The Header for our theme.
    *
    * Displays all of the <head> section and everything up till <div id=”main”>
    *
    * @package WordPress
    * @subpackage Twenty_Ten
    * @since Twenty Ten 1.0
    */
    ?><!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset=”<?php bloginfo( ‘charset’ ); ?>” />
    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;

    wp_title( ‘|’, true, ‘right’ );

    // Add the blog name.
    bloginfo( ‘name’ );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( ‘description’, ‘display’ );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo ” | $site_description”;

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ‘ | ‘ . sprintf( __( ‘Page %s’, ‘twentyten’ ), max( $paged, $page ) );

    ?></title>
    <link rel=”profile” href=”http://gmpg.org/xfn/11&#8243; />
    <link rel=”stylesheet” type=”text/css” media=”all” href=”<?php bloginfo( ‘stylesheet_url’ ); ?>” />
    <link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>” />
    <?php
    /* We add some JavaScript to pages with the comment form
    * to support sites with threaded comments (when in use).
    */
    if ( is_singular() && get_option( ‘thread_comments’ ) )
    wp_enqueue_script( ‘comment-reply’ );

    /* Always have wp_head() just before the closing </head>
    * tag of your theme, or you will break many plugins, which
    * generally use this hook to add elements to <head> such
    * as styles, scripts, and meta tags.
    */
    wp_head();
    ?>
    </head>

    <body <?php body_class(); ?>>
    <div id=”wrapper” class=”hfeed”>
    <div id=”header”>
    <div id=”masthead”>
    <div id=”branding” role=”banner”>
    <?php $heading_tag = ( is_home() || is_front_page() ) ? ‘h1’ : ‘div’; ?>
    <<?php echo $heading_tag; ?> id=”site-title”>
    <span>
    ” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ ) ); ?>” rel=”home”><?php bloginfo( ‘name’ ); ?>
    </span>
    </<?php echo $heading_tag; ?>>
    <div id=”site-description”><?php bloginfo( ‘description’ ); ?></div>

    <?php
    // Check if this is a post or page, if it has a thumbnail, and if it’s a big one
    if ( is_singular() &&
    has_post_thumbnail( $post->ID ) &&
    ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘post-thumbnail’ ) ) &&
    $image[1] >= HEADER_IMAGE_WIDTH ) :
    // Houston, we have a new header image!
    echo get_the_post_thumbnail( $post->ID, ‘post-thumbnail’ );
    else : ?>
    <img src=”<?php header_image(); ?>” width=”<?php echo HEADER_IMAGE_WIDTH; ?>” height=”<?php echo HEADER_IMAGE_HEIGHT; ?>” alt=”” />
    <?php endif; ?>
    </div><!– #branding –>

    <div id=”access” role=”navigation”>
    <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    <div class=”skip-link screen-reader-text”>“><?php _e( ‘Skip to content’, ‘twentyten’ ); ?></div>
    <?php /* Our navigation menu. If one isn’t filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
    <?php wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
    </div><!– #access –>
    </div><!– #masthead –>
    </div><!– #header –>

    <div id=”main”>

    The Admins are going to remove that code. Forum rules are no posting large amounts of code. About 10-15 lines, maybe twenty, seems to be the generally acknowledged acceptable length. Use the pastebin for more than that.

    But that is the twentyten theme’s header and you are using a theme named lifestyle. It is lifestyle’s header.php that you need to edit. This part..

    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;
    
    wp_title( '|', true, 'right' );
    
    // Add the blog name.
    bloginfo( 'name' );
    
    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( 'description', 'display' );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo " | $site_description";
    
    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
    
    ?></title>

    needs to be inserted into lifestyle’s header.php

    Thread Starter bentirongym

    (@bentirongym)

    This is weird… just looking at my website in the editor… all my other websites have this…

    Templates
    404 Template
    (404.php)

    Archive Page Template
    (page_archive.php)
    Blog Page Template
    (page_blog.php)
    Comments
    (comments.php)
    Footer
    (footer.php)
    Header
    (header.php)
    Main Index Template
    (index.php)
    Page Template
    (page.php)
    Sidebar
    (sidebar.php)
    Single Post
    (single.php)
    Theme Functions
    (functions.php)
    adsense.php
    (adsense.php)
    framework.php
    (framework.php)
    home.php
    (home.php)
    init.php
    (init.php)
    sidebar-alt.php
    (sidebar-alt.php)
    sidebar-bottom.php
    (sidebar-bottom.php)
    Styles
    Stylesheet
    (style.css)

    and my current one thats not working properally only has this…
    Templates
    Theme Functions
    (functions.php)
    adsense.php
    (adsense.php)
    home.php
    (home.php)
    sidebar-bottom.php
    (sidebar-bottom.php)
    Styles
    Stylesheet
    (style.css)

    how would that happen?

    A theme actually requires very few files to work. Most of the ones you listed are optional, and I believe that even more of them are optional if you are using a child theme.

    Thread Starter bentirongym

    (@bentirongym)

    so my current theme, lifestyle, doesnt have a header.php file? where should i place the codE?

    Thank you sooooooooooooooooooooo much for your help!

    Look for this line in your theme’s style.css: Template: ****. There should be a theme name there. Copy that theme’s header.php to your theme’s directory and then modify it. I am pretty sure that should work, but not 100% sure. 🙂

    Thread Starter bentirongym

    (@bentirongym)

    alright did all of the above, inserted and modified… inserted the below text into the header php file…
    <title><?php
    /*
    * Print the <title> tag based on what is being viewed.
    */
    global $page, $paged;

    wp_title( ‘|’, true, ‘right’ );

    // Add the blog name.
    bloginfo( ‘name’ );

    // Add the blog description for the home/front page.
    $site_description = get_bloginfo( ‘description’, ‘display’ );
    if ( $site_description && ( is_home() || is_front_page() ) )
    echo ” | $site_description”;

    // Add a page number if necessary:
    if ( $paged >= 2 || $page >= 2 )
    echo ‘ | ‘ . sprintf( __( ‘Page %s’, ‘twentyten’ ), max( $paged, $page ) );

    ?></title>

    page title is coming up on top of browser but for some reason <title> comes up on the browser too?

    That’s progress.

    The <title> stuff should be in the <head> section of the page the way it is in the twentyten theme. Somehow, you’ve got it in the body of the page. In other words, you need:

    <head>
       <!-- there may be stuff here; don't worry about it -->
       <!-- You start inserting here -->
       <title>
         <!-- bunch-o-stuff -->
       </title>
       <!-- You finish inserting here -->
       <!-- there may be stuff here; don't worry about it -->
    </head>

    Try to match the twentyten header.php file as closely as possible.

    Thread Starter bentirongym

    (@bentirongym)

    tried a couple different ways, no luck… heres my header.php.

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Looks like your theme has an unusual structure, however this should work:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter bentirongym

    (@bentirongym)

    weird, tried that and it keeps saying <title>!

    Reduce that to the minimum and see what happens.

    wp_head(); // we need this for plugins
    ?>
    <title>This is my Title</title>
    </head>
    Thread Starter bentirongym

    (@bentirongym)

    lol everything says “this is my title” now
    i think were getting closer though! thanks so much for taking the time to help me, greatly appreciated 🙂

    That’s what I was hoping, actually. 🙂 Everything should say “This is my title”

    Now you can start putting it back together so that it reads how you want to to. So, the question is, “What do you want your title to say?”

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Problems with posting pages and posts on facebook/websites’ is closed to new replies.