WordPress.org

Forums

CM Answers
[resolved] Showing Only The Head Portion of my Theme (3 posts)

  1. Christian Freeman (codelion)
    Member
    Posted 1 year ago #

    Hi guys. First of all, I want to say that this is a Great Plugin! I'm strongly considering purchasing the Pro Version, but I have an issue with the plugin. It's not showing my theme. Well, it's only showing me the Head portion of my theme. I've built the theme myself, so I know that the theme works fine. Any ideas on how I can get CM Answers to show within my theme?

    http://wordpress.org/extend/plugins/cm-answers/

  2. CM Plugins
    Member
    Plugin Author

    Posted 1 year ago #

    From the FAQ...You need to create a CMA sub-directory in your theme directory and copy all files from cm-answers/views/frontend over. You can then edit index.phtml and single.phtml located under answer folder

    If you are familiar with php/html this will be easy for you

    Plugin will use CMA files if found instead of cm-answers/views/frontend so upgrading the plugin from one version is easy

    This is not related to Pro plugin this is a basic feature of cm answers

  3. Christian Freeman (codelion)
    Member
    Posted 1 year ago #

    Thanks for the quick response, it looks like you guys are really on top of things in the support department, so at this point, I will definitely purchase the Pro version tomorrow.

    I've followed your directions to the letter, and it looks like it worked! Well, it worked partially anyway.

    After modifying index.phtml, I am now able to see the rest of my theme. But there is some kind of code conflict w/ the sidbars that you've coded into the plugin, and the sidebar that I have built into my theme.

    My sidebars are showing up on the page, but for some reason, they are showing up outside of the div that they are normally contained in. And this is causing both sidebars to show up at the bottom of the page (they're actually off of the page).

    If you can help me figure out how to get my theme working with this plugin, it would be much appreciated.

    Here's the code from my index.phtml file:

    <?php
    get_header();
    ?>
    
    		<div class="shirt-canvas">
            	<div class="shirt-content">
                	<div class="shirt-design-area"><?php echo do_shortcode('[layerslider id="1"]'); ?>
                        <div class="content-outer">
                        	<div class="content-inner">
                            <div id="primary" class="content-area">
                                <div id="content" class="site-content" role="main">
    
    <div class="cma-main">
    <div id="primary" class="site-content cma-content">
        <div id="content" role="main">
            <header class="entry-header">
            <h1 class="entry-title">
                <?php _e('All Questions', 'cm-answers'); ?>
            </h1>
            </header>
    		<div style="clear:both;height:15px;"></div>	
    
                <?php
                $currentSort = !empty($_GET['sort'])?$_GET['sort']:'newest';
                ?>
                <ul class="cma-thread-orderby">
                    <li<?php if ($currentSort=='newest'):?> class="cma-current-sort"<?php endif; ?>><a href="<?php echo add_query_arg(array('sort'=>'newest'), get_pagenum_link(0)); ?>"><?php _e('Newest', 'cm-answers'); ?></a></li>
                    <li<?php if ($currentSort=='hottest'):?> class="cma-current-sort"<?php endif; ?>><a href="<?php echo add_query_arg(array('sort'=>'hottest'), get_pagenum_link(0)); ?>"><?php _e('Hottest', 'cm-answers'); ?></a></li>
                    <?php if (CMA_AnswerThread::isRatingAllowed()): ?><li<?php if ($currentSort=='votes'):?> class="cma-current-sort"<?php endif; ?>><a href="<?php echo add_query_arg(array('sort'=>'Votes'), get_pagenum_link(0)); ?>"><?php _e('Most Votes', 'cm-answers'); ?></a></li><?php endif; ?>
                    <li<?php if ($currentSort=='views'):?> class="cma-current-sort"<?php endif; ?>><a href="<?php echo add_query_arg(array('sort'=>'views'), get_pagenum_link(0)); ?>"><?php _e('Most Views', 'cm-answers'); ?></a></li>
                </ul>
            <div class="cma-clear"></div>
            <?php
            do_action('CMA_show_messages');
            if (have_posts()):
                ?>
                <table class="cma-thread-list">
                    <?php
                    while (have_posts()):
                        the_post();
                        $thread = CMA_AnswerThread::getInstance($post->ID);
                        ?>
                        <tr><?php if (CMA_AnswerThread::isRatingAllowed()): ?><td class="cma-thread-meta">
                                <div class="cma-thread-numbers cma-thread-votes"><div class="cma-thread-numbers-count cma-thread-votes-count"><?php $votes = $thread->getVotes();
                echo $votes; ?></div><div class="cma-thread-numbers-caption cma-thread-votes-caption"><?php if ($votes==1) _e('vote', 'cm-answers'); else _e('votes', 'cm-answers'); ?></div></div></td><?php endif; ?>
                            <td class="cma-thread-meta"><div class="cma-thread-numbers cma-thread-views"><div class="cma-thread-numbers-count cma-thread-views-count"><?php $views = $thread->getViews();
                echo $views; ?></div><div class="cma-thread-numbers-caption cma-thread-views-caption"><?php if ($views==1) _e('view', 'cm-answers'); else _e('views', 'cm-answers'); ?></div></div></td>
            <?php $numberOfAnswers = $thread->getNumberOfAnswers(); ?>
                            <td class="cma-thread-meta"><div class="cma-thread-numbers cma-thread-answers<?php if ($numberOfAnswers == 0): ?> cma-thread-no-answers<?php endif; ?>"><div class="cma-thread-numbers-count cma-thread-answers-count"><?php echo $numberOfAnswers; ?></div><div class="cma-thread-numbers-caption cma-thread-answers-caption"><?php if ($numberOfAnswers==1) _e('answer', 'cm-answers'); else _e('answers', 'cm-answers'); ?></div></div>
                            </td>
                            <td class="cma-thread-summary">
                                <div class="cma-thread-title"><a href="<?php echo get_permalink($post->ID); ?>"><?php echo $thread->getTitle(); ?></a></div>
                                <div class="cma-thread-updated"><?php sprintf(__('updated %s by %s', 'cm-answers'), CMA_AnswerThread::renderDaysAgo($thread->getUpdated()), $thread->getLastPosterName()); ?></div></td></tr>
                        <?php
                    endwhile;
                    ?>
                </table>
                <div class="cma-pagination"><?php
                    echo paginate_links(array(
                        'base' => trailingslashit(get_post_type_archive_link(CMA_AnswerThread::POST_TYPE)) . '%_%',
                        'format' => 'page/%#%/',
                        'current' => max(1, get_query_var('paged')),
                        'total' => $GLOBALS['wp_query']->max_num_pages,
                        'add_args' => $currentSort!='newest'?array('sort'=>$currentSort):array()
                    ));
                    ?></div><?php
                    endif;
                ?>
           <div class="cma-form-container">
     <?php if (is_user_logged_in()): ?>
     		<div style="clear:both;height:5px;"></div>
           <form method="post" class="cma-thread-add" id="cma-thread-add">
                <input type="hidden" name="cma-action" value="add" />
                <h3 style="font-size:18px;font-weight:bold;"><?php _e('Ask a Question', 'cm-answers'); ?></h3>
    			<div style="clear:both;height:10px;"></div>
    			<ul class="cma-form-notes">
                <li><?php _e('Allow markup', 'cm-answers'); ?>: <strong>, <em>, <a></li>
                <li><?php _e('Wrap your code using', 'cm-answers'); ?> <pre></pre></li>
            </ul>
                <input type="text" size="50" name="thread_title" placeholder="<?php _e('Question Title', 'cm-answers'); ?>" /><br />
                <textarea name="thread_comment" cols="50" rows="3" placeholder="<?php _e('What is your Question about?', 'cm-answers'); ?>"></textarea><br />
        		<div style="clear:both;height:15px;"></div>
            <label>
                <input name="thread_notify" type="checkbox" value="1"/>
                <?php _e('Notify me of follow', 'cm-answers'); ?></label><br />
    			<div style="clear:both;height:10px;"></div>
                <input id="thread_submit" type="submit" value="<?php _e('Submit', 'cm-answers'); ?>" />
            </form>
               <?php endif; ?>
            </div>
        </div>
    
    </div>
    
                                </div><!-- #content .site-content -->
                            </div><!-- #primary .content-area -->
                 			</div><!-- #content-inner End -->
              				<div class="fade-bottom"></div>
                		</div><!-- #content-outer End -->
                    </div><!-- .shirt-design-area End -->
                    <div id="shirt-content-copyright"><p>Copyright &copy; Team Extreme <?php echo date('Y'); ?></p>
                    </div>
                </div> <!-- .shirt-content End -->
            </div> <!-- .shirt-canvas End -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Here's the link to my Q & A page:
    http://teamextremesupport.com/themedev/answers/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CM Answers
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic