Quantcast
Browsing latest articles
Browse All 44 View Live

Comment by Michael on How do I change the template specifically for single...

please ask in your theme's forum at wordpress.org/support/theme/period

View Article


Comment by Michael on How to output the taxonomies that are assigned to each...

review developer.wordpress.org/reference/functions/get_the_terms vs developer.wordpress.org/reference/functions/get_terms

View Article


Comment by Michael on Shortcode do not return a value

the code seems to output ok in my test site; maybe there are interfering plugins or other filters in your site?

View Article

Comment by Michael on get_sidebar() will not work in footer.php

what you posted as 'rendered html' is clearly not generated from what you posted as code in footer.php - the html tags and CSS does not match. what html code is rendered in the footer?

View Article

Comment by Michael on Display related posts without a plugin

use the functions that will return the results: get_the_title() and get_permalink() and get_the_post_thumbnail()...

View Article


Comment by Michael on Order post by modified date

do you have any sticky posts? possibly add the 'ignore_sticky_posts' parameter to the query; developer.wordpress.org/reference/classes/wp_query/…

View Article

Comment by Michael on Display related posts without a plugin

it is really about using get_the_title() instead of the_title() etc in your code...

View Article

Comment by Michael on How to show only first, second, third Custom taxonomy...

have you tried using 'offset' in the arsg? developer.wordpress.org/reference/classes/wp_term_query/…

View Article


Comment by Michael on Loop keeps showing the same post even when I click on a...

the problem might be with the template which you are calling with ` get_template_part( 'parts/splide', 'seasonsHeroSlides' );` - what is the code of that?

View Article


Comment by Michael on Read more block is appending /#more-{post_id} to the link

read codex.wordpress.org/…

View Article

Comment by Michael on “Continue reading” not on some posts, full excerpts not...

what setting are you using under 'Customize' - 'Excerpt Settings'? are you using a hand-written excerpt for the post? have you asked in the theme's forum at wordpress.org/support/theme/twentytwentyone ?

View Article

Comment by Michael on Display "large" image size and show caption in...

does the theme have an attachment.php template? developer.wordpress.org/themes/basics/template-hierarchy/… ? you might need to create and edit this accordingly.

View Article

Comment by Michael on Ignore the Ad on Specific Categories

check developer.wordpress.org/reference/functions/in_category and the examples therein

View Article


Comment by Michael on If do_shortcode is blank, return some message

possibly ask in the support forum of your plugin wordpress.org/support/plugin/post-expirator

View Article

Answer by Michael for Remove parentheses from tag cloud count

this is an example output of an tag cloud widget element (wp4.8):<a href="http://localhost/wp-beta-test/tag/handcrafted/" class="tag-cloud-link tag-link-327 tag-link-position-22" style="font-size:...

View Article


Answer by Michael for Function to alphabetically sort custom post types...

'orderby' => 'name' sorts by slug - not title;therefore, the title Imancorp Foundation which has this permalink http://www.alianzafpdual.es/las-empresas/fundacion-imancorp-foundation/ breaks the...

View Article

Answer by Michael for How to add page numbering with php?

to change the number of 'posts_per_page' for one specific category archive page (assuming your are using a different number for all other archives), try working with the 'pre_get_posts' action; see...

View Article


Answer by Michael for How to display related posts from the same category?

One possibility:$related = get_posts( array( 'category__in' => wp_get_post_categories( $post->ID ), 'numberposts' => 5, 'post__not_in' => array( $post->ID ) ) );if( $related ) { foreach(...

View Article

Answer by Michael for Can we count the Wordpress Loop

$wp_query->current_post is the build-in loop counter, starting with 0 zero for the first post in the loop.so the line some code to be executed could translate to:<?php if(...

View Article

Answer by Michael for Link won't show using the_permalink();

because the_title() expects a string for the $before and $after args, you need to use the string version of the permalink, in a string concatenation;<?php the_title('<h2 class="wow"><a...

View Article

Answer by Michael for Show 5 posts and than 3 posts offset with pagination

under settings - reading, set 'blog pages show at most' to 8then use conditional statements based on the current post number in the loop;<?php if (have_posts()) : ?><?php while (have_posts())...

View Article


Answer by Michael for Closing the loop...featured image variable based on...

try using: $featured_img_url = get_the_post_thumbnail_url($queried_post->ID, 'full');

View Article


Answer by Michael for Can I show all the template files that are being used...

this would add a column with the page template file name into the 'Pages' in the dashboard:// ONLY WORDPRESS DEFAULT PAGESadd_filter('manage_page_posts_columns', 'custom_admin_columns_head',...

View Article

Answer by Michael for How to get the number of Pages in a single Post...

have a look at https://codex.wordpress.org/Global_Variables#Inside_the_Loop_variableswithin the loop, the global variables related to the <!--nextpage--> tag are:$page - the actual sub...

View Article

Answer by Michael for Remove a specific category ID from related post

from looking at https://developer.wordpress.org/reference/functions/wp_get_post_terms/and https://developer.wordpress.org/reference/classes/wp_term_query/__construct/ for corresponding parameters, i.e....

View Article


Answer by Michael for exclude category from get_posts?

as 'get_posts()' uses the 'WP_Query()' parameters, i would assume that this should work:$laargsM = array('cat' => 7,'posts_per_page' => 300,'orderby' => 'title','order' =>...

View Article

Answer by Michael for Uncode theme, create author page and author link under...

before making edits, please consider to create a child theme for your customization; https://developer.wordpress.org/themes/advanced-topics/child-themes/to show a link to the author's page...

View Article

Answer by Michael for How to display featured image description and title?

this might work:$post_thumbnail_id = get_post_thumbnail_id($post->ID);$thumbnail_image = get_posts(array('p' => $post_thumbnail_id, 'post_type' => 'attachment'));if ($thumbnail_image...

View Article

Answer by Michael for Continue or break the while loop

'break' is the right keyword...code structure below, no custom query needed if used in a standard template.<?php $posts_per_first_section = 6; //how many posts you want to show in the first...

View Article



Answer by Michael for How to hide empty pagination button when no previous page

<nav class="pagination" role="navigation"><?php if( get_previous_posts_link() ) { ?><div id="prv" class="button pag-btn nav-next"><?php previous_posts_link( 'Previous' );...

View Article

Answer by Michael for Change logo url based on WP user role

try this filter for the logo url link; adapt your landing page links:function user_defined_logo_url( $html ) {$cur_user = wp_get_current_user();$user_role = $cur_user->roles[0];$logo_url = esc_url(...

View Article

Answer by Michael for In category.php I need to get the next 10/previous 10...

if the only difference in the category archives is the images, you can work without a custom query.in this case you could use (as suggested here...

View Article

Answer by Michael for Get custom title if category

change this one line in your code:<h1 class="article-title entry-title">How To <?php the_title(); ?> Free</h1>to:CORRECTION:<h1 class="article-title entry-title"><?php if(...

View Article


Answer by Michael for Pagination in category.php not functioning

if your aim is to restrict the category archive to your post_type 'video' and to 6 posts per page, do not edit category.php, rather use...

View Article

Answer by Michael for Don't show a tag on a post if it is the only post with...

you can try using a filter function (added into functions.php of your (child) theme), specific to your taxonomy 'topic':(based on https://developer.wordpress.org/reference/functions/get_the_term_list/...

View Article

Answer by Michael for Adding register & login in Wordpress website

integrating some of the suggested functions into your code:<?php $c_user = wp_get_current_user(); if( !is_user_logged_in( $c_user->ID ) ) : echo '<a href="' . esc_url( wp_login_url() ) . '"...

View Article


Answer by Michael for str_replace remove words from title

the_title() will directly output the title - for your purpose in a string manipulation, you need to use get_the_title()https://developer.wordpress.org/reference/functions/get_the_title/you also have...

View Article


Answer by Michael for Infinite looping next post link within a certain...

based on the docu:the $in_same_term parameter in https://developer.wordpress.org/reference/functions/next_post_link/the categories' parameters in WP_Query...

View Article

Answer by Michael for include specific Pages to wp_list_pages with filter

the corresponding hook would be https://developer.wordpress.org/reference/hooks/widget_pages_args/example code:add_filter( 'widget_pages_args','include_special_pages' );function include_special_pages(...

View Article

Answer by Michael for My custom post type not show category

the $args need to onclude 'show_in_rest' => truefrom https://developer.wordpress.org/reference/functions/register_taxonomy/'show_in_rest'(bool) Whether to include the taxonomy in the REST API. Set...

View Article

Answer by Michael for Custom HTML in specific category single page and its...

A few changes to your code:Changed the action hook to wp_head.Removed the false 'pluggable' wrapping of your function.if ( ! function_exists( 'post_is_in_descendant_category' ) ) { function...

View Article


Answer by Michael for different sidebars depending on template...

One possiblilty:Keep the new code in sidebar.php in your child theme.In blog-page.php, change the line get_sidebar('blog-sidebar'); to do_action( 'storefront_sidebar' ); (as in an original...

View Article

Answer by Michael for How to add a shortcode function that returns the...

get_the_terms() will always return an array; but because you have only one 'project_category', you can simply use its first element:add_shortcode( 'return_taxonomy_slug',...

View Article


Answer by Michael for add_filter on "the_excerpt" only works when post does...

I posted an article about this a while ago:function wp_trim_all_excerpt($text) { // Creates an excerpt if needed; and shortens the manual excerpt as well global $post; $raw_excerpt = $text; if ( '' ==...

View Article
Browsing latest articles
Browse All 44 View Live