• Hi there.
    I am using Modularity Lite. I installed Add Link to Facebook plugin and was able to have facebook comments together with wordpress comments visible on my posts. Unfortunately now I lost my wordpress comments from the posts. I was editing the theme a bit but I pretty sure I haven’t done anything with comments. But they are gone. Could anyone help me to put them back? And one more thing – is there a way how to get notification if someone comments on either wordpress or fb? Thank you for your help. Btw – my website is : https://www.jirivondrous.com

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey Jim, I assume that’s your name, LOL:

    Could you post some of your code here that you added for both the Facebook and WordPress comments? Maybe you accidentally removed the function in your theme to the comments_template()? I am just brainstorming for causes…

    Also, one thing you can do about your comment’s notification is go into your backend and turn on notifications for comments. If you want to program it, you could always add a WordPress hook in your theme’s functions.php starting with add_action() and write yourself a custom function to send your email notifications for comments. If you do not want to write any code, I am sure there are a few plugins out there you can find, but what would be the fun in that? LOL.

    Bruce

    Thread Starter wondry

    (@wondry)

    Hi 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’);

    Thread Starter wondry

    (@wondry)

    And 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 ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Lost comments in Modularity Lite’ is closed to new replies.