function ym_fbook_template() { global $facebook_settings, $facebook_client; //aborts if (is_single() && $facebook_settings->post_breakout) { add_action('wp_head', 'ym_fbook_iframe_breakout'); return; } if (is_page() && $facebook_settings->page_breakout) { add_action('wp_head', 'ym_fbook_iframe_breakout'); return; } // since inside init // call scripts wp_enqueue_style('jquery-ui', 'https://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery.ui.all.css'); wp_enqueue_script('ym-fb-nav', site_url('wp-content/plugins/ym_facebook/js/fb_nav.js'), array('jquery'), YM_FB_PLUGIN_VERSION); wp_enqueue_script('ym-fb', site_url('wp-content/plugins/ym_facebook/js/fb.js'), array('jquery'), YM_FB_PLUGIN_VERSION); wp_enqueue_style('ym-fb', site_url('wp-content/plugins/ym_facebook/css/ym_fbook.css'), array(), YM_FB_PLUGIN_VERSION); wp_enqueue_style('ym-fb-login', site_url('wp-content/plugins/ym_facebook/css/ym_fbook_login.css'), array(), YM_FB_PLUGIN_VERSION); wp_enqueue_script('jquery-ui-ymenu', site_url('wp-content/plugins/ym_facebook/js/jquery.ymenu.js'), array('jquery')); wp_enqueue_style('jquery-ui-ymenu', site_url('wp-content/plugins/ym_facebook/css/jquery.ymenu.css')); // aborts if (defined('YM_FBOOK_NO_LOOP') || defined('FBOOK_TEMPLATE_OVERRIDE')) { include YM_FBOOK_BASE_DIR . '/template/head.php'; if (defined('FBOOK_TEMPLATE_OVERRIDE')) { include YM_FBOOK_BASE_DIR . '/template/' . FBOOK_TEMPLATE_OVERRIDE . '.php'; } else { if ($_GET['login']) { ym_fbook_wp_login_form(); } } include YM_FBOOK_BASE_DIR . '/template/foot.php'; exit; } if ($facebook_settings->enable_fb_php) { if (locate_template('fb.php', TRUE)) { exit; } } // catch non permalinks if ($_GET['p']) { query_posts('p=' . $_GET['p']); } if ($_GET['page_id']) { query_posts('page_id=' . $_GET['page_id']); } include YM_FBOOK_BASE_DIR . '/template/head.php'; include YM_FBOOK_BASE_DIR . '/template/loop.php'; // comments comments_template('', TRUE); include YM_FBOOK_BASE_DIR . '/template/foot.php'; exit; }
<?php if (ym_get('login', FALSE)) { ym_fbook_wp_login_form(); return; } if (ym_get('ym_fb_profile', FALSE)) { ym_fbook_profile(TRUE); return; } // query_posts(); if (have_posts()) { while (have_posts()) { the_post(); echo ' <div class="post"> <h2><a href="' . get_permalink() . '" rel="bookmark" title="Permanent Link to ' . the_title_attribute(array('echo' => false)) . '"'; if ($facebook_settings->post_breakout) { echo ' target="_parent" '; } echo '>' . get_the_title() . '</a></h2> '; // if ($facebook_settings->use_excerpt && !is_singular()) { //echo do_shortcode(get_the_excerpt()); // the_excerpt(); // } else { //echo do_shortcode(get_the_content()); the_content(); // } echo ym_fbook_render_like_button(get_permalink(), 'post'); echo '</div>';