New answers tagged


Can't this be done by css? .nav_posts .title { display: inline-block; text-overflow: ellipsis; max-width: 30ex; white-space: nowrap; overflow: hidden; } <?php previous_post_link('<span class="nav_posts left">&larr; <span class="title">%link</span></span>'); next_post_link('<span class="nav_posts ...


Here's a little coding that should implement this for you: <?php $max_length = 5; // set max character length here $next = get_next_post()->ID; $prev = get_previous_post()->ID; if( $prev ) { $title = get_the_title( $prev ); $link = get_the_permalink( $prev ); $post_name = mb_strlen( $title ) > $max_length ? mb_substr( $title, 0, ...


Both of these should trickle down to get_adjacent_post_link() function, which passes result through dynamic {$adjacent}_post_link filter (where $adjacent is previous or next). You should be able to use this filter to make any changes to final output.


The left padding will be the default 40 pixels added to a ul by the browser. When I style WP menus I use this to make sure all browsers are happy: .blog-nav li, .blog-nav ul { padding: 0; margin: 0; }


Here's a way to support pagination titles of the form: <!--nextpage(.*?)?--> in a simlar way as the core supports <!--more(.*?)?-->. Here's an example: <!--nextpage Planets --> Let's talk about the Planets <!--nextpage Mercury --> Exotic Mercury <!--nextpage Venus--> Beautiful Venus <!--nextpage Earth --> Our Blue ...


You can use filter wp_link_pages_link First pass our custom string placeholder (This can be anything you like except string containing %, just for now I am using #custom_title#). wp_link_pages( array( 'pagelink' => '#custom_title#' ) ); Then add our filter in functions.php. In callback function make an array of titles then check for the current page ...


You can deregister that style in your child theme functions.php function remove_shoreditch_background() { wp_deregister_style('shoreditch-style'); } add_action('wp_enqueue_scripts', 'remove_shoreditch_background'); Or you could remove that action entirely remove_action('wp_enqueue_scripts', 'shoreditch_post_nav_background'); Or you can just ...


If your theme fully supports child themes copy template-tags.php to the child theme folder and edit it as needed.


Answer by Implode solve issue only if you are not using other queries like 'meta_key' even . I found complete solution here. function fix_nav_menu( $query ) { if ( $query->get( 'post_type' ) === 'nav_menu_item' ) { $query->set( 'tax_query', '' ); $query->set( 'meta_key', '' ); $query->set( 'orderby', '' ); } } ...

Top 50 recent answers are included