Forum Replies Created

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter GeraldW

    (@geraldw)

    alchymyth:

    The CSS worked perfectly. Thanks so much!

    Thread Starter GeraldW

    (@geraldw)

    Here are two screen shots showing the difference between the original code and your code. I reverted the site back to its original state.

    View post on imgur.com

    Thread Starter GeraldW

    (@geraldw)

    Update: I just removed the ability to comment on any of my posts and the comment button has been removed but beautiful circles have disappeared.

    Did you have a look at the site before?

    Thread Starter GeraldW

    (@geraldw)

    Hi Simalam.

    Thanks so much for working on that for me.

    I’ve just replaced the original code with yours and while it did remove links on the featured image posts… it also removed the “circles” and added what I think are comment buttons under the cinematography and photography posts…

    check the site out:

    http://www.geraldwiblin.com

    I’ll leave it up for a few minutes

    Thread Starter GeraldW

    (@geraldw)

    Hi Simalam,

    What I’m after is:

    When there is no featured image, show title and have it link.

    When there is a featured image, show the featured image but remove the link from it.

    Thread Starter GeraldW

    (@geraldw)

    Where as I want the opposite… sort of.

    As outputing a post title link is on by default, this is only confirming it?

    Where as I want it to remove what is on by default, but only if the post has a featured image…

    So the code in its current form won’t work =\

    Thread Starter GeraldW

    (@geraldw)

    Hi Caroline,

    I was given this piece of code:

    <?php if ( has_post_thumbnail()) { ?>
    <?php } else { ?>
    	<?php the_title(); ?>
    <?php } ?>

    but I’m not sure where to put it. I stuck it into a content-home.php file in my child theme but that broke everything on the site!

    Is there a particular spot in the original content-home.php that I should be looking at?

    Thread Starter GeraldW

    (@geraldw)

    Hi Triptripper,

    I tested that code out in a completely empty content-home.php file in my child theme and it broke my site (nothing showed up and some text about broken syntax). I’m not sure if it is the code or my process of inserting it.

    I’ve always used the 1-click child theme plug-in which makes my child theme style sheets for me and I’ve never had to edit one of the .php files in a child theme.. so it was my first time doing that.

    Using my FTP I downloaded the content-home.php and re-uploaded it into my childtheme’s folder. It then shows up in my child theme editor (all good I think)

    But I’m not sure what else needs to be in that content-home.php? When your piece of code is the only code in there it breaks the site.

    the website in question is http://www.geraldwiblin.com

    and the entire content-home.php code is here:

    <?php
    /**
     * @package Spun
     * @since Spun 1.0
     */
    
    global $post;
    
    if ( '' != get_the_post_thumbnail() ) {
    	$thumb = get_the_post_thumbnail( $post->ID, 'single-post' );
    }
    else {
    	$args = array(
    				'post_type' => 'attachment',
    				'numberposts' => 1,
    				'post_status' => null,
    				'post_mime_type' => 'image',
    				'post_parent' => $post->ID,
    			);
    
    	$first_attachment = get_children( $args );
    
    	if ( $first_attachment ) {
    		foreach ( $first_attachment as $attachment ) {
    			$thumb = wp_get_attachment_image( $attachment->ID, 'single-post', false );
    		}
    	}
    }
    ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    	<?php if ( '' != $thumb ) { ?>
    		<div class="single-post-thumbnail">
    			<?php echo $thumb; ?>
    		</div>
    	<?php } ?>
    	<header class="entry-header">
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    	</header><!-- .entry-header -->
    
    	<div class="entry-content">
    		<?php the_content(); ?>
    		<?php wp_link_pages( array( 'before' => '<div class="page-links">', 'after' => '</div>', 'link_before' => '<span class="active-link">', 'link_after' => '</span>' ) ); ?>
    	</div><!-- .entry-content -->
    
    	<footer class="entry-meta">
    		<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
    			<span class="comments-link">
    				<a href="#comments-toggle">
    					<span class="tail"></span>
    					<?php echo comments_number( __( '+', 'spun' ), __( '1', 'spun' ), __( '%', 'spun' ) ); ?>
    				</a>
    			</span>
    		<?php endif; ?>
    		<span class="post-date">
    			<?php spun_posted_on(); ?>
    		</span>
    		<?php
    			/* translators: used between list items, there is a space after the comma */
    			$categories_list = get_the_category_list( __( ', ', 'spun' ) );
    			if ( $categories_list && spun_categorized_blog() ) :
    		?>
    		<span class="cat-links">
    			<?php printf( __( '%1$s', 'spun' ), $categories_list ); ?>
    		</span>
    		<?php endif; // End if categories ?>
    
    		<?php
    			/* translators: used between list items, there is a space after the comma */
    			$tags_list = get_the_tag_list( '', __( ', ', 'spun' ) );
    			if ( $tags_list ) :
    		?>
    
    		<span class="tags-links">
    			<?php printf( __( '%1$s', 'spun' ), $tags_list ); ?>
    		</span>
    		<?php endif; // End if $tags_list ?>
    
    		<?php edit_post_link( __( 'Edit', 'spun' ), '<span class="edit-link">', '</span>' ); ?>
    	</footer><!-- .entry-meta -->
    </article><!-- #post-<?php the_ID(); ?> -->

    I’m not sure what to do with your piece of code?

    Thread Starter GeraldW

    (@geraldw)

    if(has_post_thumbnail()) {
    <?php the_title();
    }

    Is the closest I got piecing other bits together but it didn’t do anything except break my entire site.

    Thread Starter GeraldW

    (@geraldw)

    Alternatively, is there a way of specifying that any post with a thumbnail doesn’t have a working title link>

    Thread Starter GeraldW

    (@geraldw)

    Ah I realised that the children pages were not set to the “default” template which was causing the problem.

    All fixed now.

Viewing 11 replies - 16 through 26 (of 26 total)