Check if excerpt is empty at loop-portfolio
Try this one , .. $ID = get_the_ID(); $page_data = get_page( $ID ); $excerp = strip_tags($page_data->post_excerpt); if ( !empty( $excerp ) ) : the_excerpt(); else : echo get_permalink() endif;
Try this one , .. $ID = get_the_ID(); $page_data = get_page( $ID ); $excerp = strip_tags($page_data->post_excerpt); if ( !empty( $excerp ) ) : the_excerpt(); else : echo get_permalink() endif;
I’m not sure how you’re settings up your menus but this is probably the most reliable method. function auto_custom_type_class( $classes, $item ) { $type = get_post_type( $item->object_id ); if( $type == “marke” && has_term( “laden-1”, “laden”, $item->object_id ) ) { $classes []= “laden-1”; } return $classes; } add_filter(‘nav_menu_css_class’, ‘auto_custom_type_class’, 10, 2 ); The problem with … Read more
How to mirror exactly the left admin menu on front end?
According to Codex Embeds documentation: It also allows you to set a maximum (but not fixed) width and height, like so: For the_post_thumbnail() you arguments usage seems wrong, $size is first argument and it doesn’t come in that format ( the_post_thumbnail( array( 240, 170 ); ).
Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
wp_upload_bits – define (sub)folder / (sub)directory before filename?
Because WordPress loads jQuery in no conflict mode, $ is not accessible as a global variable. You need to explicitly use jQuery. jQuery(document).ready(function () { jQuery(“#login”).loginWidget({ partnerRef: 0000, }); }); If, like me, you want to use $ anyway, you can pass it to the ready function. jQuery(document).ready(function ($) { // you can use $ … Read more
Use Shift + Enter. Soft and Hard Returns.
On top of my head scheme like this should work: // functions.php function prefix_get_settings() { return array(‘haha’ => ‘hehe’); } add_filter( ‘prefix_default_settings’, ‘prefix_get_settings’, 9 ); // plugin $default_settings = apply_filters( ‘prefix_default_settings’, array() );
Sanitize html, where to sanitize