예제 #1
0
        ?>
"><?php 
        the_post_thumbnail(array(150, 100));
        ?>
</a>
                                </div>
                                <h4><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
        ?>
">
                                    <?php 
        if (get_the_title()) {
            echo Shredfast_NoBreakWord(the_title('', '', false), 20);
        } else {
            the_ID();
        }
        ?>
                                </a></h4>
                        </li>
                     <?php 
    }
    ?>
                </ul>
        </section>
        <?php 
} else {
    ?>
       
예제 #2
0
/**
 * 
 * @param type $length
 * if length is 0, apear all.
 * @return string
 */
function get_title_excerpt($length = 20)
{
    $html = '<a href="' . get_permalink() . '" title="' . esc_attr(get_the_title() ? get_the_title() : get_the_ID()) . '">';
    if (get_the_title()) {
        if ($length == 0) {
            $excerptTitle = get_the_title();
        } else {
            $excerptTitle = Shredfast_NoBreakWord(get_the_title(), $length);
            if (strlen(get_the_title()) > $length) {
                $excerptTitle .= '...';
            }
        }
    } else {
        $excerptTitle = the_ID();
    }
    $html .= $excerptTitle . '</a>';
    return $html;
}