smrdo
Forum Replies Created
-
Forum: Plugins
In reply to: [Block Lab] Stylesheets not workingHi,
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 4 years, 7 months ago by smrdo.
Forum: Plugins
In reply to: [Block Lab] set excerpt lengthHi, 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?
Forum: Plugins
In reply to: [Block Lab] Getting the “Original” Post ID using the POST field@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!!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
sorry about the spelling, i’ve been up half the night (tight deadliine) and typing quickly ??
Forum: Fixing WordPress
In reply to: adding css class to the first and every fith postTHat worked perfectly, thanks very much for your help
Forum: Fixing WordPress
In reply to: adding css class to the first and every fith postMany Thanks for that, I’ll try it out today
Forum: Fixing WordPress
In reply to: adding css class to the first and every fith postno 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?
Forum: Fixing WordPress
In reply to: Next Gen Gallery, gallery template in an albumThanks Alex, that works perfectly..
Forum: Plugins
In reply to: using a template for galleries within an albumnope that didnt work at all, it stil uses the default template when i view the gallery.
Really want to avoid editing gallery.phpForum: Plugins
In reply to: using a template for galleries within an albumI’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.phpForum: Fixing WordPress
In reply to: Multiple blog-like areas on a site (newbie)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.
Forum: Fixing WordPress
In reply to: catch_that_image only showing image pathno problem, glad it helped
Forum: Fixing WordPress
In reply to: catch_that_image only showing image pathJust 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, likethemename/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
Forum: Fixing WordPress
In reply to: catch_that_image only showing image pathHi 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="" />