Forum Replies Created

Viewing 15 replies - 1 through 15 (of 43 total)
  • Thread Starter lightfoot33

    (@lightfoot33)

    Thanks, but this doesn’t help much since changing core files in WordPress is really frowned upon by most WordPress developers.

    It’s a shame there isn’t any other solution.

    Thread Starter lightfoot33

    (@lightfoot33)

    The comments.php file (taken directly from the latest WordPress theme) has no such line. Can you please advise where and/or to exactly add this line of code you are suggesting?

    <?php
    /**
     * The template for displaying comments
     *
     * The area of the page that contains both current comments
     * and the comment form.
     *
     * @package WordPress
     * @subpackage Twenty_Fifteen
     * @since Twenty Fifteen 1.0
     */
    
    /*
     * If the current post is protected by a password and
     * the visitor has not yet entered the password we will
     * return early without loading the comments.
     */
    if ( post_password_required() ) {
    	return;
    }
    ?>
    
    <div id="comments" class="comments-area">
    
    	<?php if ( have_comments() ) : ?>
    		<h2 class="comments-title">
    			<?php
    				printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentyfifteen' ),
    					number_format_i18n( get_comments_number() ), get_the_title() );
    			?>
    		</h2>
    
    		<?php twentyfifteen_comment_nav(); ?>
    
    		<ol class="comment-list">
    			<?php
    				wp_list_comments( array(
    					'style'       => 'ol',
    					'short_ping'  => true,
    					'avatar_size' => 56,
    				) );
    			?>
    		</ol><!-- .comment-list -->
    
    		<?php twentyfifteen_comment_nav(); ?>
    
    	<?php endif; // have_comments() ?>
    
    	<?php
    		// If comments are closed and there are comments, let's leave a little note, shall we?
    		if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
    	?>
    		<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
    	<?php endif; ?>
    
    	<?php $comment_args = array( 'fields' => apply_filters( 'comment_form_default_fields', array(
                'author' => '' .
                            '<label for="author">' . __( 'Your Name:' ) . '</label> ' .
                            ( $req ? '<span class="required">*</span>' : '' ) .
                            '<input id="author" name="author" type="text" value="' .
                            esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />' .
                            '<!-- #form-section-author .form-section -->',
                'email'  => '' .
                            '<label for="email">' . __( 'Your Email:' ) . '</label> ' .
                            ( $req ? '<span class="required">*</span>' : '' ) .
                            '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />' .
                    '<!-- #form-section-email .form-section -->',
                'url'    => '' ) ),
                'comment_field' => '' .
                            '<label for="comment">' . __( 'Comment:' ) . '</label>' .
                            '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>' .
                            '<!-- #form-section-comment .form-section -->',
                'comment_notes_after' => '',
            );
            comment_form($comment_args); ?>
    
    </div><!-- .comments-area -->
    Thread Starter lightfoot33

    (@lightfoot33)

    If anyone else is looking for this solution, I got the following code to work:

    <?php
    if ($post->post_parent) {
    	//get the parrent and see if it'a a top page (has no parent)
    	$parent = get_page($post->post_parent);
    	if ($parent->post_parent) {
    		//if it's not a top page, then his parent should be
    		$children = wp_list_pages('title_li=&depth=1&child_of=' . $parent->post_parent . '&echo=0');
    	} else {
    		$children = wp_list_pages('title_li=&depth=1&child_of=' . $post->post_parent . '&echo=0');
    	}
    } else {
    	$children = wp_list_pages('title_li=&depth=1&child_of=' . $post->ID . '&echo=0');
    }
    if ($children) { ?>
    	<ul>
    	<?php
    		if ($post->ancestors[1]) {
    			$ancestor_title = get_the_title($post->ancestors[1]);
    			$ancestor_link = get_permalink($post->ancestors[1]);
    		?>
    		<h3><a href="<?php echo $ancestor_link; ?>"><?php echo $ancestor_title; ?></a></h3>
    		<?php } elseif ($post->post_parent) {
    			$parent_title = get_the_title($post->post_parent);
    			$parent_link = get_permalink($post->post_parent);
    		?>
    		<li><a href="<?php echo $parent_link; ?>"><?php echo $parent_title; ?></a></li>
    		<?php } else { ?>
    		<li class="current_page_item"><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></li>
    		<?php } echo $children;?>
    	</ul>
    <?php } ?>
    Thread Starter lightfoot33

    (@lightfoot33)

    That did the trick. (Duh.) Sorry I didn’t try that before posting here. Thank you!

    I am having the same issue. Have you (or anyone) found a solution?

    I found the answer on another forum…
    Create single-qa_faqs.php in your theme folder and this will apply to single FAQ pages.

    Hi Pmagony,

    I have run into the exact same scenario as you. (Single FAQs don’t use the same template as the main FAQ page, or the single.php page.) Did you ever get this problem resolved?

    Thread Starter lightfoot33

    (@lightfoot33)

    After a week of continuing to try to solve this issue, I still haven’t had any luck. Thanks x500.net for your link, but unfortunately that plugin duplicated too many things and did not play nice with some of the other plugins.

    It’s hard for me to believe that there isn’t a script or plugin that tells the search feature to index everything in the database — both in the media gallery and in other folders/data tables, but either one doesn’t, or I haven’t found it yet.

    If anyone else comes across this post and has a solution to this problem, please let me know!

    Thread Starter lightfoot33

    (@lightfoot33)

    Ah, that makes sense. Unfortunately, writing a script like that is a little outside my comfort zone. Do you know where I might begin looking to find one?

    Thread Starter lightfoot33

    (@lightfoot33)

    We haven’t been uploading images via FTP to the uploads folder. That’s not the issue at hand. The issue is whether we can include a way for the search feature to index images that have been uploaded using a gallery plugin to a folder in wp-content… For example, this image is NOT being listed when you search for “imagename” : mysite.com/wp-content/fancygallery/imagename.jpg but it is listed if it’s in: mysite.com/wp-content/uploads/2013/03/imagename.jpg

    Does that help clarify? In short, I am just needing a way for the search feature to list images that are also outside of the uploads folder.

    Thread Starter lightfoot33

    (@lightfoot33)

    I figured out the solution. I have categories and sub-categories. I thought using the parent category ID# would automatically include all the children categories as well, but it appears that I have to actually list out all the children categories as well.

    Thread Starter lightfoot33

    (@lightfoot33)

    Thanks, but I assume that would mean I need to create custom post types, which would change the navigation in the dashboard? I think this would be problematic since there are already hundreds of posts on the site and I was hoping to use code (like I tried above) to make it much more automatic and apply to previous posts.

    Thread Starter lightfoot33

    (@lightfoot33)

    Totally missed the obvious solution for this… By adding it to the PHP code that calls for the widget.

    Thread Starter lightfoot33

    (@lightfoot33)

    I try that if I can’t figure it a CSS solution.

    Thread Starter lightfoot33

    (@lightfoot33)

    I understand that. This is the filter I was trying to use but it didn’t work:

    add_filter( ‘wp_nav_menu_objects’, create_function( ‘$menu’, ‘return array_reverse( $menu );’ ) );

    Thanks for you help. I think I will just figure out a different solution using CSS. I was just hoping to avoid reworking what was already there by using a filter, but at this point, it might be faster to find a different solution.

Viewing 15 replies - 1 through 15 (of 43 total)