Forum Replies Created

Viewing 15 replies - 76 through 90 (of 2,107 total)
  • Yes!

    Have a look at this post and the section content color, the post has a download so you can see the code!

    It uses color-1, color-2, color-3, color-4 and color-5, color-6 and color-7, adding the class to the post class:

    So for 5 you would just change the $divisor to 5 like this:

    <?php
    /* Set the class based on the modulus of the current_post counter
       $counter will be 0 to 4, we add 1 to current_post which is zero based */
    global $wp_query;
    $divisor = 5;
    $counter = ($wp_query->current_post + 1) % $divisor;
    //Add the classes to the $class variable
    $class = $counter ? 'color-' .$counter : 'color-' .$divisor;
    ?>
    
    <?php /* Comment: We have added the $class to the post_class() */ ?>
    <article id="post-<?php the_ID(); ?>" <?php post_class( $class ); ?>>

    HTH

    David

    I have re-uploaded the images after each change in the image size.

    It will be something really silly when you find what is going wrong, as my code returned no image in the loop then it looks like the featured image size has not been set!

    I am assuming that this is not a child theme but one you are building bottom up?
    Q: In functions.php you have set the post thumbnail Featured Image size?

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 960, 320, true );
    add_image_size('home-feature', 960, 320, true);
    add_image_size('news-main', 960, 206, true);
    add_image_size('news', 49, 87, true);

    1: Then when you run the thumbnail rebuild can you see all sizes?

    2: For each post you have set the featured image from the post edit page?

    3: Create a post, upload a brand new image (or rename one), set this ‘new image’ as the ‘featured image’ and view post, see what you have!

    If still no image showing, then post functions.php and the file where you are calling the image to http://pastebin.com and add the links to a reply!

    HTH

    David

    I use this in my themes ‘inside the loop’ and it works fine, so yours should work!

    <?php if( has_post_thumbnail() ) : ?>
          <div class="aligncenter">
    	<?php the_post_thumbnail( 'news-main' ); ?>
          </div>
    <?php endif; ?>

    Q: You are testing on a new post ‘featured image’ that you have uploaded after adding the code, WordPress will not retrospectivly rebuild the thumbnails?
    Q: You uploaded or set the ‘featured image’ at least 960px wide?
    Q: 960px is wide for an image, is the content area wide enough?

    Test:
    Go to any post, and upload a featured image wider than 960px and check again.

    Test:
    Use the Ajax Thumbnail Rebuild Plugin, and test again.

    HTH

    David

    Hi,
    I am not sure what you mean by not give post formats and set this as a default?

    Do you mean the single page layout?

    You can just use a custom single.php to display your episodes and save single.php as episode.php, then you can use a custom loop to control the output.

    In functions.php (Child Theme) add:

    /* A single.php just for custom post type == 'episode' */
    function my_episode_template_redirect() {
    	global $wp;
    	if ($wp->query_vars['post_type'] == 'episode') {
    		if( file_exists( get_stylesheet_directory() . '/episode.php') ) {
    			include( get_stylesheet_directory() . '/episode.php');
    			die();
    		}
    	}
    }
    add_action("template_redirect", 'my_episode_template_redirect');

    Note: in a child theme we use get_stylesheet_directory() in a parent theme we change this and use get_template_directory()

    HTH

    David

    Hi,
    Try this, it will output only on the footer on a page or single post, it will output all the meta data values in an array tree!
    Example:

    <?php
    if( is_singular() ) :
    	global $post;
    	$post_meta = array();
    	$post_meta = get_post_meta( $post->ID, false );
    	var_dump($post_meta);
    endif;
    ?>

    Add it inside the page tag!

    </div><!-- #page -->
    
    <?php wp_footer(); ?>
    
    </body>
    </html>

    HTH

    David

    Hi newyorkcity,

    You are using the $post global in the footer?

    Is that the post footer or the template footer, inside or outside the loop?

    Outside the loop!

    <?php if( is_post() ) : ?>
    <?php global $post; ?>
    <?php echo get_post_meta($post->ID, 'smashing-post-class', true); ?>
    <?php endif; ?>

    Inside the loop!

    <?php echo get_post_meta( get_the_ID() , 'smashing-post-class', true); ?>

    HTH

    David

    Hi,
    Go to the categories, and edit the Wolves category, and look at the field textbox for {slug} copy that value to the code!

    Testing here created the slug ‘wolves-in-sheeps-clothing’ check your slug field.

    HTH

    David

    Use the slug instead of the title, WordPress would have sanitize the title to make the slug, lowercase, hyphons for spaces etc:

    category.php code

    <?php
    global $cat;
    $category = get_category($cat);
    $cat_slug = $category->slug;
    $the_slugs = array('booklets', 'woolves-in-sheeps-clothing' ,'fruit-that-remains');
    
    if (in_array( $cat_slug, $the_slugs ) ) query_posts($query_string . "&order=ASC");
    ?>
    
    <?php if ( have_posts() ) : ?>

    This post might also help, it has category headers, custom page title, custom post description, different content layout per category, and the ‘asc’ etc:!

    HTH

    David

    I’m VERY familiar with watermarks. Watermarks are suitable when providing a portfolio of a shoot to a client but are inappropriate for website general gallery/viewing purposes.

    Watermarks are an acceptable way of presenting any media where you want to protect your IP and copyright, website mockups are presented to blue chip companies with watermarked composite images inserted.

    Just ‘disable the right mouse click’ will not stop anyone from grabbing the images, if someone wants a copy there are a large number of ways to get it, and as Jan said:

    those scripts are not effective and tick off your readers… I think you may be going about this the wrong way.

    The right way is just to minimise the risk, only display an image on the internet if you are prepared for some copies being made as you cannot prevent it.

    Minimise the infringement risk, only upload a low resolution image at a fixed size for the website, with or without a watermark.

    If your clients are visiting the website and you think they might grab a copy then you could put up a small clean thumbnail linked to a larger watermarked image.

    Maybe an over reaction as there are billions upon billions of images on the internet, the chances of someone visiting and stealing an image are minute and a risk you have to take, if you want to have your portfolio online.

    Ideas:
    Looking at websites for top photograpers they seem to use flash or sprite scripts.

    Have a look to see if ther is a sprite plugin or script, something that would chop the image into little pieces and rebuild it on the page.

    Splice the image yourself say sixteen bits, then upload it to the post and rebuild it in the content, a lot of work though.

    David

    Try asking over on WordPress.com, this is the wrong place for that theme, I think you have a WordPress.com website and there are theme modification restrictions on WordPress.com, because it is a hosted solution.

    If you are hosted on WordPress.com just look for a wider responsive theme, the content area on your existing theme is fixed in several places in the stylesheet at 800px.

    This website and forum is for the self hosting WordPress blogs.

    HTH

    David

    Both of these options are up to your requirements, if you want to control a slider and set the defaults to suit your theme then build them in, you can like in the link, add a theme setup to an admin page.
    Or you could just add support in your theme for an existing plugin, add some styles or a function that changes the layout if the plugin is present.

    HTH

    David

    I wrote this code for a page template page of posts, it should have most of what you want.

    There is a download of a child theme with the code on this post, it might be easier to look at!

    HTH

    David

    This may help!

    David

    The Graphene theme supports child themes, so create several child themes, where you can alter the layouts, set the defaults etc, without affecting the parent.

    Graphene:

    The codes are written so that you can easily override or add functionality to the theme by using your own child theme without altering the parent theme’s code.

    Page content you can use the export and import from the tools menu.

    HTH

    David

    @creativepassion,
    Please open a new topic rather than resurecting an old one, as the original poster will get email notifications as we post.

    It is likely that you have multi-site and cannot use the editor from the admin area.

    If this is not the answer then create a new topic, do not reply here.

    HTH

    David

Viewing 15 replies - 76 through 90 (of 2,107 total)