wondry
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Lost comments in Modularity LiteAnd this my comments.php file. Can you see anything wrong or missing there? Thanks for help.
Jiri.<?php /** * @package WordPress * @subpackage Modularity */ ?> <?php // Do not delete these lines if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); if (!empty($post->post_password)) { // if there's a password if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie ?> <p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.', 'modularity' ); ?></p> <?php return; } } ?> <!-- You can start editing here. --> <?php if ($comments) : ?> <h3 id="comments"><?php comments_number( __( 'Leave a comment', 'modularity' ), __( 'One Response', 'modularity' ), __( '% Responses', 'modularity' ) );?></h3> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <div id="comment-nav-above" class="nav-interior comments-nav"> <div class="prev"><?php previous_comments_link( __( '← Older Comments', 'modularity' ) ); ?></div> <div class="next"><?php next_comments_link( __( 'Newer Comments →', 'modularity' ) ); ?></div> </div> <div class="clear"></div> <?php endif; // check for comment navigation ?> <ol class="commentlist snap_preview"> <?php wp_list_comments( array( 'callback' => 'modularity_comment' ) ); ?> </ol> <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> <div id="comment-nav-below" class="nav-interior comments-nav"> <div class="prev"><?php previous_comments_link( __( '← Older Comments', 'modularity' ) ); ?></div> <div class="next"><?php next_comments_link( __( 'Newer Comments →', 'modularity' ) ); ?></div> </div> <div class="clear"></div> <?php endif; // check for comment navigation ?> <?php else : // this is displayed if there are no comments so far ?> <?php if ('open' == $post->comment_status) : ?> <!-- If comments are open, but there are no comments. --> <?php else : // comments are closed ?> <!-- If comments are closed. --> <p class="nocomments"><?php _e( 'Comments are closed.', 'modularity' ); ?></p> <?php endif; ?> <?php endif; ?> <?php if ('open' == $post->comment_status) : ?> <?php comment_form(); ?> <?php endif; // if you delete this the sky will fall on your head ?>
Forum: Themes and Templates
In reply to: Lost comments in Modularity LiteHi Bruce. My name is Jiri. ??
For WordPress comments I did not add anything it was default. For Facebook I first add code for FB comments that I found on FB developers site. Then I activate plugin Add Link to Fb and removed the code that I previously added. That’s it. This is my functions.php file.<?php
/**
* @package WordPress
* @subpackage Modularity
*/$themecolors = array(
‘bg’ => ‘111111’,
‘border’ => ‘111111’,
‘text’ => ‘eeeeee’,
‘link’ => ‘428CE7’,
‘url’ => ‘428CE7’
);
$content_width = 950; // pixels// Grab the theme options page
require_once ( get_template_directory() . ‘/theme-options.php’ );// Add default posts and comments RSS feed links to head
add_theme_support( ‘automatic-feed-links’ );// Add post thumbnail theme support
add_theme_support( ‘post-thumbnails’ );
set_post_thumbnail_size( 150, 150, true );// Add a new image size
add_image_size( ‘modularity-slideshow’, 950, 425, true );// Register nav menu locations
register_nav_menus( array(
‘primary’ => __( ‘Primary Navigation’, ‘text_domain’ ),
) );// Get wp_page_menu() lookin’ more like wp_nav_menu()
function modularity_page_menu_args( $args ) {
$args[‘show_home’] = true;
$args[‘menu_class’] = ‘main-nav’;
return $args;
}
add_filter( ‘wp_page_menu_args’, ‘modularity_page_menu_args’ );// Give Modularity a custom background
add_custom_background();// Allow custom colors to clear the background image
function modularity_custom_background_color() {
if ( get_background_image() == ” && get_background_color() != ” ) { ?>
<style type=”text/css”>
body {
background-image: none;
}
</style>
<?php }
}
add_action( ‘wp_head’, ‘modularity_custom_background_color’ );// To use a sidebar, or not to use a sidebar, that is the question. This generates the appropriate class
function modularity_sidebar_class() {
$options = get_option( ‘modularity_theme_options’ );if ( $options[‘sidebar’] == 1 ) {
echo “15 colborder home”;
}
else {
echo “24 last”;
}
}// The header business begins here:
// No CSS, just IMG call
define(‘HEADER_TEXTCOLOR’, ”);
define(‘HEADER_IMAGE’, ”);
define(‘HEADER_IMAGE_WIDTH’, 950);
define(‘HEADER_IMAGE_HEIGHT’, 200);
define( ‘NO_HEADER_TEXT’, true );function modularity_admin_header_style() {
?>
<style type=”text/css”>
#headimg {
height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
}#headimg h1, #headimg #desc {
display: none;
}</style>
<?php
}add_custom_image_header( ”, ‘modularity_admin_header_style’ );
// and thus ends the header business// Comments in the Modularity style
function modularity_comment( $comment, $args, $depth ) {
$GLOBALS[‘comment’] = $comment;
switch ( $comment->comment_type ) :
case ” :
?>
<li <?php comment_class(); ?> id=”li-comment-<?php comment_ID(); ?>”>
<div id=”comment-<?php comment_ID(); ?>” class=”comment-wrapper”>
<div class=”comment-meta”>
<?php echo get_avatar( $comment, 75 ); ?>
<div class=”comment-author vcard”>
<strong class=”fn”><?php comment_author_link(); ?>
</div><!– .comment-author .vcard –>
</div>
<div class=”comment-entry”>
<?php if ( $comment->comment_approved == ‘0’ ) : ?>
<?php _e( ‘Your comment is awaiting moderation.’, ‘modularity’ ); ?><?php endif; ?>
<?php comment_text(); ?>
<p class=”post-time”>
<?php
/* translators: 1: date, 2: time */
printf( __( ‘%1$s at %2$s’, ‘modularity’ ), get_comment_date(), get_comment_time() ); ?><?php edit_comment_link( __( ‘(Edit)’, ‘modularity’ ), ‘ ‘ );
?></p>
<div class=”reply”>
<?php comment_reply_link( array_merge( $args, array( ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’] ) ) ); ?>
</div><!– .reply –>
</div>
</div><!– #comment-## –><?php
break;
case ‘pingback’ :
case ‘trackback’ :
?>
<li class=”pingback”>
<p><?php _e( ‘Pingback:’, ‘modularity’ ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __(‘(Edit)’, ‘modularity’), ‘ ‘ ); ?></p>
<?php
break;
endswitch;
}// The Sidebar business
$options = get_option( ‘modularity_theme_options’ );
if ( $options[‘sidebar’] == 0 ) {
$optional_description = __( ‘The optional Modularity Lite sidebar is currently deactivated but can be activated from Appearance > Theme Options’, ‘modularity’ );
} else {
$optional_description = ”;
}if ( function_exists(‘register_sidebar’) ) {
register_sidebar(array(
‘name’ => ‘Sidebar’,
‘id’ => ‘sidebar’,
‘description’ => $optional_description,
‘before_widget’ => ‘<div id=”%1$s” class=”item %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”sub”>’,
‘after_title’ => ‘</h3>’,
));register_sidebar(array(
‘name’ => ‘Footer 1’,
‘id’ => ‘footer-1’,
‘before_widget’ => ‘<div id=”%1$s” class=”item %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”sub”>’,
‘after_title’ => ‘</h3>’,
));register_sidebar(array(
‘name’ => ‘Footer 2’,
‘id’ => ‘footer-2’,
‘before_widget’ => ‘<div id=”%1$s” class=”item %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”sub”>’,
‘after_title’ => ‘</h3>’,
));register_sidebar(array(
‘name’ => ‘Footer 3’,
‘id’ => ‘footer-3’,
‘before_widget’ => ‘<div id=”%1$s” class=”item %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”sub”>’,
‘after_title’ => ‘</h3>’
));register_sidebar(array(
‘name’ => ‘Footer 4’,
‘id’ => ‘footer-4’,
‘before_widget’ => ‘<div id=”%1$s” class=”item %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”sub”>’,
‘after_title’ => ‘</h3>’
));
}// Load Base Javascripts
if (!is_admin()) add_action( ‘init’, ‘load_base_js’ );
function load_base_js( ) {wp_enqueue_script(‘jquery’);
//wp_enqueue_script(‘jquerynav’, get_bloginfo(‘template_directory’).’/js/nav.js’, array(‘jquery’));
wp_enqueue_script(‘cycle’, get_bloginfo(‘template_directory’).’/js/jquery.cycle.js’, array(‘jquery’));
//wp_enqueue_script(‘search’, get_bloginfo(‘template_directory’).’/js/search.js’, array( ‘jquery’ ) );}
// Load Dom Ready Javascripts
function load_dom_ready_js() { ?><script type=”text/javascript”>
/* <![CDATA[ */
jQuery(document).ready(function(){
jQuery(function() {
jQuery(“#slideshow”).cycle({
speed: ‘2500’,
timeout: ‘500’,
pause: 1
});
});
});
/* ]]> */
</script><?php }
add_action(‘wp_head’, ‘load_dom_ready_js’);