chanel
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Sidebar Not At The Sidejcow – the theme I am using was created by someone else who coded it incorrectly. So in Single Post (single.php), there was a missing </div> that needed to be added above <?php get_sidebar(); ?>
Forum: Fixing WordPress
In reply to: Comment Counthttps://diaryofchanel.com/discuss is the page I am referring to.
That particular page has subpages. So far I only have 2 listed like this1. domestic violence
2. abortionIdeally, i would like to show on my Discuss page, how many comments each SUBPAGE/TOPIC has. ie:
1. domestic violence (18 comments)
2. abortion (32 comments)Here is how I have the Discuss page coded, with it’s own template:
<?php
/*
Template Name: Discussions
*/
?><?php get_header(); ?>
<div id=”side-left”>
<div id=”content”><?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”kutu”>
<div class=”ust”><span></span></div><div class=”post” id=”post-<?php the_ID(); ?>”>
<h2 class=”pagetitle”><?php the_title(); ?></h2>
This section is an open forum for viewers to discuss & debate random topics per week. I will be posting “The Topic Of The Week” as it will allow us to converse about highlights of the media, politics, celebrity gossip, life & relationships, and parenting. Topics are posted in a numerical order (the highest number being the most recent topic) For those that are subscribed, you will receive an email notification when the new topic is posted! So if you’re interested in being involved, please subscribe to my mailing list. Thank you.<div class=”entrytext”>
<?php
if($post->post_parent)
$children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=0″);
else
$children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);
if ($children) { ?>-
<?php echo $children; ?>
<?php } ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php edit_post_link(‘Edit this entry.’, ‘<p style=”margin:10px;”>’, ‘</p>’); ?>
<br class=”clear” />
<div class=”alt”><span></span></div></div>
</div></div>
<?php get_sidebar(); ?><?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: Character limit on comment authorThank you jcow. I will try that and return with the results.
Forum: Fixing WordPress
In reply to: Ignored Topics/IssuesContinually “bumping” your post over the course of one day can be a problem when you want an answer.
1 – “bumping” a topic is so it can go back to the front page. Most likely a new volunteer will be able to see it, not when it’s on page 6 of the forum lists. And I don’t see why someone would purposely ignore it just because I “bumped it too much”. That just shows cattiness amongst adults.
A lot of people will skim through for postings that only have 1 post in them in order to try and get people some help. You effectively had a conversation with yourself, from a quick-look point-of-view, you didn’t need help because somebody was helping you.
2 – Don’t be so quick to assume. Just because someone else ended up helping me, doesn’t take away from the fact that I still needed help. It may have took that person, and myself, hours to figure it out, where has here, it would have took an hour maybe?. Also, having someone else help me could have had a monetary value ($$$ per hour).
Also posting that much code (your first link) can turn people away, especially when it is not tagged as “code”, making it even more chaotic.
3 – Oh! So posting TOO MUCH information isn’t the operative thing to do now? For the specific topic I needed assistance with, the issue WAS in the actual code. Which i knew for a fact. i just didn’t know where to find it, being that I’m a php novice.
Usually the listings I see go unanswered are heavily documented or answered over and over already, or the questions are too ambiguous and hard to understand, or, sometimes, when you keep posting on top of yourself, so people don’t see that your thread needs attention.
4 – That’s null & void in my situation (and other topics I’ve seen ignored by other members) because none of those entities apply to me or them.
Just my perspective.
5. Thanks for submitting your view on the matter.
Forum: Fixing WordPress
In reply to: Ignored Topics/Issuesthanks for responding with your view of things stvwlf. I think those are great reasons you’ve posted.
So, let me pick your brain, did I leave out pertinent information in these following topics as to why they went unanswered? (in your opinion):
https://www.ads-software.com/support/topic/250776?replies=5
https://www.ads-software.com/support/topic/250693?replies=4
https://www.ads-software.com/support/topic/245487?replies=10
Forum: Fixing WordPress
In reply to: Sidebar Not At The SideI fixed it. “Thanks for all the help”.
Forum: Fixing WordPress
In reply to: Sidebar Not At The SideHere’s the comment.php also. I have a feeling it’s one of these 2 files jacking it all up:
<?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”>Post Status: LOCKED. Email me for the password.<p>
<?php
return;
}
}
?><!– You can start editing here. –>
<div align=”justify”><?php if ($comments) : ?>
<h3 id=”comments”><?php comments_number(__(‘Comments’), __(‘1 Comment’), __(‘% Comments’));?></h3><ol id=”commentlist”>
<?php foreach ($comments as $comment) : ?>
<li id=”comment-<?php comment_ID() ?>”>
<?php if (function_exists(‘gravatar’)) { ?><img src=”<?php gravatar(“X”, 50, “”); ?>” class=”gravatar” alt=”Gravatar Icon” Align=”right” hspace=”5″and vspace=”5″/><?php } ?> <h4 class=”commentauthor”><?php comment_author_link() ?>
<?php _e(‘said,’); ?></h4>
<p class=”commentmeta”><?php comment_date(‘F j, Y’) ?> <?php _e(‘at’); ?> ” title=”<?php _e(‘Permanent link to this comment’); ?>”><?php comment_time() ?> <?php edit_comment_link(__(‘Edit’),’ · ‘,”); ?></p>
<?php comment_text() ?><?php endforeach; /* end for each comment */ ?>
<?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. –><?php endif; ?>
<?php endif; ?><?php if (‘open’ == $post->comment_status) : ?>
<h3 id=”postcomment”><?php _e(‘Post a Comment’); ?></h3>
<?php if ( get_option(‘comment_registration’) && !$user_ID ) : ?>
<p><?php _e(‘You must be’); ?>e /wp-login.php?redirect_to=<?php the_permalink(); ?>”><?php _e(‘logged in’); ?> <?php _e(‘to post a comment.’); ?></p>
<?php else : ?><form action=”<?php echo get_option(‘siteurl’); ?>/wp-comments-post.php” method=”post” id=”commentform”>
<?php if ( $user_ID ) : ?>
<p><?php _e(‘Logged in as’); ?> /wp-admin/profile.php”><?php echo $user_identity; ?>. /wp-login.php?action=logout” title=”<?php _e(‘Log out of this account’); ?>”><?php _e(‘Logout’); ?> »</p>
<?php else : ?>
<p>
<input type=”text” name=”author” id=”author” value=”<?php echo $comment_author; ?>” size=”28″ tabindex=”1″ />
<label for=”author”><?php _e(‘Name’); ?> <?php if ($req) _e(‘(required)’); ?></label>
</p><p>
<input type=”text” name=”email” id=”email” value=”<?php echo $comment_author_email; ?>” size=”28″ tabindex=”2″ />
<label for=”email”><?php _e(‘E-mail’); ?> <?php if ($req) _e(‘(required)’); ?></label>
</p><p>
<input type=”text” name=”url” id=”url” value=”<?php echo $comment_author_url; ?>” size=”28″ tabindex=”3″ />
<label for=”url”><abbr title=”<?php _e(‘Uniform Resource Identifier’); ?>”><?php _e(‘URI’); ?></abbr></label>
</p><?php endif; ?>
<p>
<textarea name=”comment” id=”comment” cols=”80″ rows=”10″ tabindex=”4″></textarea>
</p><p>
<input name=”submit” type=”submit” id=”submit” tabindex=”5″ value=”<?php _e(‘Submit Comment’); ?>” />
<input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />
</p><?php do_action(‘comment_form’, $post->ID); ?>
</form>
</div>
<?php endif; // If registration required and not logged in ?><?php endif; // if you delete this the sky will fall on your head ?>
Forum: Fixing WordPress
In reply to: Sidebar Not At The SideHere is Single Post (single.php)
<?php get_header(); ?>
<div id=”content”>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<img src=”<?php bloginfo(‘template_url’);
?>/images/post_title01.png” align=”left” alt=”” /> <font size=”4″ face=”Georgia”>” title=”<?php _e(‘Permanent link to’); ?><?php the_title(); ?>”><?php the_title(); ?></font>
<font size=”1″ face=”georgia”><?php the_time(‘F jS, Y’) ?> @ <?php the_time() ?></font>
<div align=”justify”><?php the_content(”); ?></div>
<?php wp_link_pages(); ?>
<img src=”<?php bloginfo(‘template_url’); ?>/images/filed_in.png” alt=”” /> <?php the_category(‘ · ‘) ?></div>
<?php comments_template(); ?><?php endwhile; else: ?>
<h2 class=”pagetitle”><?php _e(‘Search Results’); ?></h2>
<p><?php _e(‘Sorry, but no posts matched your criteria.’); ?></p>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?><?php endif; ?>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
Forum: Fixing WordPress
In reply to: Comments on PagesI think you add this to the the page.php file for where you want the comments to show:
<?php comments_template(); ?>
Then when you create a new page, you need to select the Default Template (which is Page.php).
Forum: Fixing WordPress
In reply to: Comment Count On Page Listsstill need help.
Forum: Fixing WordPress
In reply to: Comment Count On Page Listsbump.
Forum: Fixing WordPress
In reply to: Comment Count On Page Listsbump.
Forum: Fixing WordPress
In reply to: Comment Count On Page ListsAsecrest, I tried that and it gave me a fatal error.
If I was to post the archives.php (which is actually run by a plugin) are you able to lead me to the right direction?
here’s the php for the plugin:
<?php /*
**************************************************************************
Plugin Name: Clean Archives Reloaded
Plugin URI: https://www.viper007bond.com/wordpress-plugins/clean-archives-reloaded/
Description: A slick, Javascript-enhanced post archive list generator for WordPress 2.5+.
Version: 3.1.5
Author: Viper007Bond
Author URI: https://www.viper007bond.com/**************************************************************************
Copyright (C) 2008 Viper007Bond
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.**************************************************************************/
class CleanArchivesReloaded {
# Configuration has been moved to the new options page at Settings -> Clean Archives.
# You can also set the configuration via the shortcode tag.// Class initialization
function CleanArchivesReloaded() {
if ( !function_exists(‘add_shortcode’) ) return;// Load up the localization file if we’re using WordPress in a different language
// Place it in this plugin’s “languages” folder and name it “car-[value in wp-config].mo”
load_plugin_textdomain( ‘clean-archives-reloaded’, FALSE, ‘/clean-archives-reloaded/languages’ );// Make sure all the plugin options have defaults set
if ( FALSE === get_option(‘car_usejs’) ) add_option( ‘car_usejs’, 1 );
if ( FALSE === get_option(‘car_monthorder’) ) add_option( ‘car_monthorder’, ‘new’ );
if ( FALSE === get_option(‘car_postorder’) ) add_option( ‘car_postorder’, ‘new’ );
if ( FALSE === get_option(‘car_dynamicload’) ) add_option( ‘car_dynamicload’, NULL );// Register all the hooks
add_action( ‘admin_menu’, array(&$this, ‘AddAdminMenu’) );
add_shortcode( ‘cleanarchivesreloaded’ , array(&$this, ‘PostList’) );
add_shortcode( ‘cartotalposts’ , array(&$this, ‘PostCount’) );
add_filter( ‘widget_text’, ‘do_shortcode’, 11 ); // For the text widget// Hook into wp_head early so we can potentially look for posts
add_action( ‘wp_head’, array(&$this, ‘MaybeEnqueueCSSJavascript’), 1 );// For users with a persistent object caching plugin installed, we need to dump the cache in some cases
add_action( ‘save_post’, array(&$this, ‘DeleteCache’) );
add_action( ‘edit_post’, array(&$this, ‘DeleteCache’) );
add_action( ‘delete_post’, array(&$this, ‘DeleteCache’) );
}// Register the admin menu
function AddAdminMenu() {
add_options_page( __(‘Clean Archives Reloaded’, ‘clean-archives-reloaded’), __(‘Clean Archives’, ‘clean-archives-reloaded’), ‘manage_options’, ‘clean-archives-reloaded’, array(&$this, ‘OptionsPage’) );
}// The options page for this plugin
function OptionsPage() { ?><div class=”wrap”>
<h2><?php _e(‘Clean Archives Reloaded’, ‘clean-archives-reloaded’); ?></h2><form method=”post” action=”options.php”>
<?php wp_nonce_field(‘update-options’) ?><table class=”form-table”>
<tr>
<th scope=”row” colspan=”2″ class=”th-full”>
<label for=”car_usejs”>
<input name=”car_usejs” type=”checkbox” id=”car_usejs” value=”1″ <?php checked( ‘1’, get_option(‘car_usejs’) ); ?> />
<?php _e(‘Use Javascript to make the months collapsible’, ‘clean-archives-reloaded’); ?>
</label>
</th>
</tr>
<tr>
<th scope=”row” colspan=”2″ class=”th-full”>
<label for=”car_dynamicload”>
<input name=”car_dynamicload” type=”checkbox” id=”car_dynamicload” value=”1″ <?php checked( ‘1’, get_option(‘car_dynamicload’) ); ?> />
<?php _e(“Only load the Javascript files when displaying an archive (this will break the archive list if it’s used in your sidebar)”, ‘clean-archives-reloaded’); ?>
</label>
</th>
</tr>
<tr valign=”top”>
<th scope=”row”><?php _e(‘Month Ordering’, ‘clean-archives-reloaded’); ?></th>
<td>
<p>
<label><input name=”car_monthorder” type=”radio” value=”new” <?php checked( ‘new’, get_option(‘car_monthorder’) ); ?> /> <?php _e(‘Show newest months first’, ‘clean-archives-reloaded’); ?></label>
<label><input name=”car_monthorder” type=”radio” value=”old” <?php checked( ‘old’, get_option(‘car_monthorder’) ); ?> /> <?php _e(‘Show oldest months first’, ‘clean-archives-reloaded’); ?></label>
</p>
</td>
</tr>
<tr valign=”top”>
<th scope=”row”><?php _e(‘Post Ordering’, ‘clean-archives-reloaded’); ?></th>
<td>
<p><?php _e(‘Within individual months…’, ‘clean-archives-reloaded’); ?></p>
<p>
<label><input name=”car_postorder” type=”radio” value=”new” <?php checked( ‘new’, get_option(‘car_postorder’) ); ?> /> <?php _e(‘Show newest posts first’, ‘clean-archives-reloaded’); ?></label>
<label><input name=”car_postorder” type=”radio” value=”old” <?php checked( ‘old’, get_option(‘car_postorder’) ); ?> /> <?php _e(‘Show oldest posts first’, ‘clean-archives-reloaded’); ?></label>
</p>
</td>
</tr>
</table><p class=”submit”>
<input type=”submit” name=”Submit” value=”<?php _e(‘Save Changes’) ?>” />
<input type=”hidden” name=”action” value=”update” />
<input type=”hidden” name=”page_options” value=”car_usejs,car_monthorder,car_postorder,car_dynamicload” />
</p></form>
</div><?php
}// If the user wants to, then look forward at the posts or Page to be displayed and check for the shortcode
// This allows for only loading jQuery and this plugin’s CSS/JS when the archive will be displayed
function MaybeEnqueueCSSJavascript() {
global $wp_query;// If the user opted to only have the JS/CSS loaded when the archive is to be displayed, then check for it
if ( 1 == get_option(‘car_dynamicload’) ) {
// Abort if no posts (obviously)
if ( !is_array($wp_query->posts) || empty($wp_query->posts) ) return;// Loop through each post looking for the shortcode
foreach ( $wp_query->posts as $post ) {
if ( FALSE !== stristr( $post->post_content, ‘[cleanarchivesreloaded’) || FALSE !== stristr( $post->post_content, ‘[cartotalposts’) ) {
wp_enqueue_script( ‘jquery’ );
add_action( ‘wp_head’, array(&$this, ‘OutputCSSJavascript’) ); // Even though we’re in wp_head right now, default of 10 is greater than 1
return;
}
}
}// Else load regardless
else {
wp_enqueue_script( ‘jquery’ );
add_action( ‘wp_head’, array(&$this, ‘OutputCSSJavascript’) ); // Even though we’re in wp_head right now, default of 10 is greater than 1
}
}// Output a little helper CSS and the Javascript for the plugin
// Based on code from https://www.learningjquery.com/2007/03/accordion-madness
function OutputCSSJavascript() { ?><!– Clean Archives Reloaded v3.1.2 | https://www.viper007bond.com/wordpress-plugins/clean-archives-reloaded/ –>
<style type=”text/css”>.car-collapse .car-yearmonth { cursor: s-resize; } </style>
<script type=”text/javascript”>
/* <![CDATA[ */
jQuery(document).ready(function() {
jQuery(‘.car-collapse’).find(‘.car-monthlisting’).hide();
jQuery(‘.car-collapse’).find(‘.car-monthlisting:first’).show();
jQuery(‘.car-collapse’).find(‘.car-yearmonth’).click(function() {
jQuery(this).next(‘ul’).slideToggle(‘fast’);
});
jQuery(‘.car-collapse’).find(‘.car-toggler’).click(function() {
if ( ‘<?php echo js_escape( __(‘Expand All’, ‘clean-archives-reloaded’) ); ?>’ == jQuery(this).text() ) {
jQuery(this).parent(‘.car-container’).find(‘.car-monthlisting’).show();
jQuery(this).text(‘<?php echo js_escape( __(‘Collapse All’, ‘clean-archives-reloaded’) ); ?>’);
}
else {
jQuery(this).parent(‘.car-container’).find(‘.car-monthlisting’).hide();
jQuery(this).text(‘<?php echo js_escape( __(‘Expand All’, ‘clean-archives-reloaded’) ); ?>’);
}
return false;
});
});
/* ]]> */
</script><?php
}// Grab all posts and filter them into an array
function GetPosts() {
// If we have a cached copy of the filtered posts array, use that instead
if ( $posts = wp_cache_get( ‘posts’, ‘clean-archives-reloaded’ ) )
return $posts;// Get a simple array of all posts
$rawposts = get_posts( ‘numberposts=-1’ );// Trim memory some
foreach ( $rawposts as $key => $rawpost )
$rawposts[$key]->post_content = null;// Loop through each post and sort it into a structured array
foreach( $rawposts as $key => $post ) {
$posts[ mysql2date( ‘Y.m’, $post->post_date ) ][] = $post;$rawposts[$key] = null; // Try and free up memory for users with lots of posts and poor server configs
}
$rawposts = null; // More memory cleanup// Store the results into the WordPress cache
wp_cache_set( ‘posts’, $posts, ‘clean-archives-reloaded’ );return $posts;
}// Generates the HTML output based on $atts array from the shortcode
function PostList( $atts = array() ) {
global $wp_locale;// Set any missing $atts items to the defaults
$atts = shortcode_atts(array(
‘usejs’ => get_option(‘car_usejs’),
‘monthorder’ => get_option(‘car_monthorder’),
‘postorder’ => get_option(‘car_postorder’),
‘postcount’ => ‘1’,
‘commentcount’ => ‘1’,
), $atts);// Get the big array of all posts
$posts = $this->GetPosts();// Sort the months based on $atts
( ‘new’ == $atts[‘monthorder’] ) ? krsort( $posts ) : ksort( $posts );// Sort the posts within each month based on $atts
foreach( $posts as $key => $month ) {
$sorter = array();
foreach ( $month as $post )
$sorter[] = $post->post_date_gmt;$sortorder = ( ‘new’ == $atts[‘postorder’] ) ? SORT_DESC : SORT_ASC;
array_multisort( $sorter, $sortorder, $month );
$posts[$key] = $month;
unset($month);
}// Generate the HTML
$html = ‘<div class=”car-container’;
if ( 1 == $atts[‘usejs’] ) $html .= ‘ car-collapse’;
$html .= ‘”>’. “\n”;if ( 1 == $atts[‘usejs’] ) $html .= ‘‘ . __(‘Expand All’, ‘clean-archives-reloaded’) . “\n\n”;
$html .= ‘<ul class=”car-list”>’ . “\n”;
$firstmonth = TRUE;
foreach( $posts as $yearmonth => $posts ) {
list( $year, $month ) = explode( ‘.’, $yearmonth );$firstpost = TRUE;
foreach( $posts as $post ) {
if ( TRUE == $firstpost ) {
$html .= ‘- <span class=”car-yearmonth”>’ . sprintf( __(‘%1$s %2$d’), $wp_locale->get_month($month), $year );
if ( ‘0’ != $atts[‘postcount’] ) $html .= ‘ <span title=”‘ . __(‘Post Count’, ‘clean-archives-reloaded’) . ‘”>(‘ . count($posts) . ‘)</span>’;
$html .= “</span>\n <ul class=’car-monthlisting’>\n”;
$firstpost = FALSE;
} - ‘ . mysql2date( ‘d’, $post->post_date ) . ‘: ID ) . ‘”>’ . get_the_title( $post->ID ) . ‘‘;
// Unless comments are closed and there are no comments, show the comment count
if ( ‘0’ != $atts[‘commentcount’] && ( 0 != $post->comment_count || ‘closed’ != $post->comment_status ) && empty($post->post_password) )
$html .= ‘ <span title=”‘ . __(‘Comment Count’, ‘clean-archives-reloaded’) . ‘”>(‘ . $post->comment_count . ‘) cmnts</span>’;$html .= “
$html .= ‘
\n”;
}$html .= ” \n \n”;
}$html .= “\n</div>\n”;
return $html;
}// Returns the total number of posts
function PostCount() {
$num_posts = wp_count_posts( ‘post’ );
return number_format_i18n( $num_posts->publish );
}// Deletes the cached filtered posts array for users using a persistent caching plugin
function DeleteCache() {
wp_cache_delete( ‘posts’, ‘clean-archives-reloaded’ );
}
}// Start this plugin once all other plugins are fully loaded
add_action( ‘plugins_loaded’, create_function( ”, ‘global $CleanArchivesReloaded; $CleanArchivesReloaded = new CleanArchivesReloaded();’ ) );// Some backwards compatibility wrapper functions
function car_total_posts() {
global $CleanArchivesReloaded;
return $CleanArchivesReloaded->PostCount();
}
function clean_archives_reloaded() {
global $CleanArchivesReloaded;
echo $CleanArchivesReloaded->PostList();
}
function car_regenerate() {
return FALSE;
}?>
Forum: Fixing WordPress
In reply to: Comment Count On Page ListsShane, I have searched for a plug-in and I cannot find one.
That’s why I posted the topic. -_-
Forum: Fixing WordPress
In reply to: Comment Count On Page Listsstill need help with this.
- <span class=”car-yearmonth”>’ . sprintf( __(‘%1$s %2$d’), $wp_locale->get_month($month), $year );