Forum Replies Created

Viewing 15 replies - 1 through 15 (of 26 total)
  • Hi,
    I found with some of my Custom Blocks I had to target the “editor wrapper” inorder to override default editor block styles (plus use an !important declaration), as in this example:

    .editor-styles-wrapper .highlight p {
    	font-size: 1.5em!important;
    }

    maybe that will help?

    • This reply was modified 5 years, 10 months ago by smrdo.

    Hi, what does your Block Template look like?

    Ive limited the excerpt like this,
    in your functions.php add

    //limit length of Excerpt
    function limit_words($string, $word_limit) {
    	// creates an array of words from $string (this will be our excerpt)
    	// explode divides the excerpt up by using a space character
    	$words = explode(' ', $string);
    	// this next bit chops the $words array and sticks it back together
    	// starting at the first word '0' and ending at the $word_limit
    	// the $word_limit which is passed in the function will be the number
    	// of words we want to use
    	// implode glues the chopped up array back together using a space character
    	return implode(' ', array_slice($words, 0, $word_limit));
     }

    Im using the “post” block type to display a chose post, in the template im using the following to display & limit the exerpt..

    <?php echo limit_words(get_the_excerpt(block_sub_value( 'your-block-type-sub-value' )->ID), '55'); ?>

    mines a sub-value as its in a repeater field, so adjust that as necessary..

    hope that helps?

    Thread Starter smrdo

    (@smrdo)

    @lukecarbis Hi Luke,
    brill, thankyou thats a huge confidence boost lol, I spent hours trying to do this..lol
    the double ;; I’ll check , must have been tired!!

    • This reply was modified 5 years, 11 months ago by smrdo.
    • This reply was modified 5 years, 11 months ago by smrdo.
    smrdo

    (@smrdo)

    Hi, I’ve tried this and it works perfectly with the wrap, however it stops the actual “load more” working, I’ve set the inital display to 16 using the shortcode

    <?php
    echo do_shortcode('[ajax_load_more post_type="cc_porfolio" taxonomy="portfolio_cat" taxonomy_terms="'.$term->slug.'" button_label="loading" posts_per_page="8" order="ASC" orderby="menu_order"]');
    ?>

    Cant figure this out at all, any ideas musch appreciated

    Thread Starter smrdo

    (@smrdo)

    sorry about the spelling, i’ve been up half the night (tight deadliine) and typing quickly 🙂

    Thread Starter smrdo

    (@smrdo)

    THat worked perfectly, thanks very much for your help

    Thread Starter smrdo

    (@smrdo)

    Many Thanks for that, I’ll try it out today

    Thread Starter smrdo

    (@smrdo)

    no at the moment its using this, which i’ve kind of got working,

    <?php
        $pj_style_classes = array('threecol','threecol','threecol','threecol', 'threecol first');
        $pj_styles_count = count($pj_style_classes);
        $pj_style_index = 0;
    ?>

    and
    <article id="post-<?php the_ID(); ?>" class="<?php echo $pj_style_classes[$pj_style_index++ % $pj_styles_count]; ?>" role="article">

    this is adding “first” to every 5th post, I’ve taken care of the first one by adding the post-Id to the css,

    not great but its working, just wondered if there something neater maybe?

    Thread Starter smrdo

    (@smrdo)

    Thanks Alex, that works perfectly..

    Thread Starter smrdo

    (@smrdo)

    nope that didnt work at all, it stil uses the default template when i view the gallery.
    Really want to avoid editing gallery.php

    Thread Starter smrdo

    (@smrdo)

    I’ve tried this, but its must be old now as the line doesn’t exist

    Patch the line 285 in nggfunctions.php
    remove:
    $out = nggShowGallery($galleryID);

    insert:
    $out = nggShowGallery($galleryID, $template);

    You have to place gallery-extend.php template in “view” folder if you use [album id=1 template=extend]
    I simply copied gallery-caption.php to gallery-extend.php

    you could also use magic fields – to create a custom write panel for each type of post (news, bibliography etc) – you than set that write panel so it automatically assigns a chosen category to a new post.

    no problem, glad it helped

    Just leave ‘template directory’ as it is, thats a standard reference to your theme, you dont need to edit it.

    it shouldnt matter if the images are in an assetts folder,
    i tested by instertng an image through the html editor stored in an assetts folder, like

    themename/images/assetts/myimage.jpg

    as long as the image is in the post it should still be found.

    this what i used to show the first image if no feature image was set up, im also using tim thumb to create a thumbnail, but ignore that bit if not needed, you should be able to see i’ve placed the call to ‘catch_that_image’ in a div just before the excerpt, athough you could put it any where in the loop

    <div class="thumbTest">
            <?php if ( has_post_thumbnail() ) {
    			the_post_thumbnail();
    			} else { ?>
    				<img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo catch_that_image() ?>" alt="" />
    			<?php  } ?>
    
            </div>
    
    					<div class="entry-content">
    						<?php the_excerpt(); ?>
    						<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    						<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
    					</div><!-- .entry-content -->
                        <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    				</div><!-- #post-## -->

    hope that helps

    Hi you need to call the catch_that_image function as the source of your image tag, like:

    <img src="<?php bloginfo('template_directory'); ?><?php echo catch_that_image() ?>" alt="" />

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