makta112
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Display two columns, remove blank spaceOk, how can I make the left column look like the one to the right? I want the images to keep their original heights.
Forum: Fixing WordPress
In reply to: Display two columns, remove blank spaceI’m using this to display the content:
<article id="post-<?php the_ID(); ?>" class="index-article<?php if ( !((1 + $wp_query->current_post) % 2) ) echo ' index-article-right' ?>">
Forum: Themes and Templates
In reply to: Remove "Continue reading" from excerptsThe entire page went white when I added the code.
Do I need to remove or replace some code in functions.php before adding this one?
This is how my child theme’s functions.php looks like:
<?php function twentyeleven_posted_on() { printf( __( '<span class="sep"></span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a> / <span class="by-author"><span class="sepp"><?php the_author(); ?></span><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ), get_the_author() ); } add_action( 'after_setup_theme', 'twentyeleven_child_continue_reading_setup' ); function twentyeleven_child_continue_reading_setup() { remove_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' ); add_filter( 'get_the_excerpt', 'twentyeleven_child_custom_excerpt_more' ); remove_filter( 'excerpt_more', 'twentyeleven_child_auto_excerpt_more' ); add_filter( 'excerpt_more', 'twentyeleven_child_auto_excerpt_more' ); } function twentyeleven_child_custom_excerpt_more($output ) { if ( is_search() && has_excerpt() && ! is_attachment() ) { //edited 'continue reading' for search results// $output .= ' <a href="'. esc_url( get_permalink() ) . '">' . 'Search Results Continue Reading <span class="meta-nav">→</span>' . '</a>'; } elseif ( has_excerpt() && ! is_attachment() ) { $output .= ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>'; } return $output; } function twentyeleven_child_auto_excerpt_more($output ) { //edited 'continue reading' for search results// if( is_search() ) { return ' …' . ' <a href="'. esc_url( get_permalink() ) . '">' . 'More...' . '</a>'; } else { return ' …' . twentyeleven_continue_reading_link(); } } // Replaces the excerpt "more" text by a link function new_excerpt_more($more) { global $post; return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read the full article...</a>'; } add_filter('excerpt_more', 'new_excerpt_more'); // Get combined FB and WordPress comment count function full_comment_count() { global $post; $url = get_permalink($post->ID); $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url); $json = json_decode($filecontent); $count = $json->$url->comments; $wpCount = get_comments_number(); $realCount = $count + $wpCount; if ($realCount == 0 || !isset($realCount)) { $realCount = 0; } return $realCount; } add_filter( 'comment_form_defaults', 'twentyelevenchild_modify_comment_fields' ); function twentyelevenchild_modify_comment_fields( $fields ) { $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; $fields['logged_in_as'] = '<p class="logged-in-as">' . sprintf( __( 'Logged in as <b>%2$s</b>. <a href="%3$s" title="Log out of this account">Not you?</a>' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( ) ) ) ) . '</p>'; $fields['must_log_in'] = '<p class="must-log-in">' . sprintf( __( 'You must be logged in to post a comment<br><div id="member"><a href="/wp-login.php" class="simplemodal-login">Login</a><a href="/wp-login.php?action=register" class="simplemodal-register">Register</a></div>' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>'; return $fields; } add_filter('body_class', 'blacklist_body_class', 20, 2); function blacklist_body_class($wp_classes, $extra_classes) { if( is_single() || is_page() ) : // List of the classes to remove from the WP generated classes $blacklist = array('singular'); // Filter the body classes foreach( $blacklist as $val ) { if (!in_array($val, $wp_classes)) : continue; else: foreach($wp_classes as $key => $value) { if ($value == $val) unset($wp_classes[$key]); } endif; } endif; // Add the extra classes back untouched return array_merge($wp_classes, (array) $extra_classes); } show_admin_bar(false); function twentyeleven_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> <nav id="<?php echo $nav_id; ?>"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> <?php wp_pagenavi(); ?> </nav><!-- #nav-above --> <?php endif; } add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); function my_post_image_html( $html, $post_id, $post_image_id ) { $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>'; return $html; }
Forum: Themes and Templates
In reply to: Remove "Continue reading" from excerptsYes – I’m using a child theme for Twenty Eleven.
Forum: Themes and Templates
In reply to: Remove "Continue reading" from excerptsalchymyth
That didn’t work. The site crashed when I used it.
Forum: Themes and Templates
In reply to: Remove "Continue reading" from excerptsTwenty Eleven. I downloaded it from WordPress.
Forum: Fixing WordPress
In reply to: php tag inside php tagThanks!
Forum: Plugins
In reply to: [Featured Item Slider] JS error when no slider on pageAny way to avoid this?
Forum: Themes and Templates
In reply to: Display the latest post from a specific categoryIs it possible to make the post-title a link to the real post?
Forum: Themes and Templates
In reply to: Display the latest post from a specific categoryDidn’t know that. Thanks!
Forum: Themes and Templates
In reply to: Display the latest post from a specific categoryThanks. But does this code go in functions.php or where I want it to display?
I used ‘shortcode’ because I need one to display a the post… Don’t I?
Forum: Themes and Templates
In reply to: Hvaing trouble centeringForum: Everything else WordPress
In reply to: Centering nav-linksThank you for your time, but I don’t think I should use it because it will look different in different resolution.
Forum: Everything else WordPress
In reply to: Centering nav-linksHi, thanks. This is what happens when I do that: https://share.xboxlife.dk/file/nwnjyje3odmymziynwflmjvkmjqwzjkwmgyynzbhmzu.jpg
Is it possible to keep the background where it is?
Forum: Everything else WordPress
In reply to: Centering nav-linksNo. Last week it was the access area, now it’s navigation links.
I’ve tried the same thing now but it won’t work…