New answers tagged theme-development
1
vote
Accepted
Post and page content not displaying in search results
The problem in your code is that your function is only returning the content when is_page() is true, which is not on the default search results page, where is_search() is true. Likewise, the content ...
1
vote
Accepted
PHP File_exist() not working - Checking if File Exist in WordPress Theme Directory
Most of this code is unnecessary. You're attempting to convert a URL to a path when you could just use the function that returns a path.
$path = get_theme_file_path( 'archive.php' );
if ( file_exists(...
1
vote
Accepted
Hide Heading if ACF Field is empty
Move the outer(of the two) div.local_faq inside the if statement which checks if the faq field is set, because that’s the outer parent container. Also it would make sense to change the outer container ...
0
votes
Navbar- disable "onClick" drop-down
This approach uses global variable to return false for link click in desktop but true on mobile and tablet. Also works for resized windows.
$(document).ready(function () {
win_width = $(window)....
1
vote
searchform.php override not working
The person who posted this question is probably taking this Udemy course because I recognize the code:
Complete WordPress Developer Course - Plugins & Themes
I'm also taking the course and here's ...
0
votes
How to add CSS class to custom logo?
You can use get_custom_logo_image_attributes filter
add_filter( 'get_custom_logo_image_attributes', function(
$custom_logo_attr, $custom_logo_id, $blog_id )
{
$custom_logo_attr['class'] = 'your-...
0
votes
How to move page template files like page-{slug}.php to a sub-directory?
Use the filter {$type}_template_hierarchy to alter the templates that WP searches.
Example: move page's templates in a subdirectory and remove the "page-" prefix.
add_filter('...
Top 50 recent answers are included
Related Tags
theme-development × 4331themes × 693
php × 418
plugin-development × 390
functions × 304
customization × 279
plugins × 266
css × 218
theme-customizer × 205
custom-post-types × 204
menus × 194
child-theme × 192
loop × 157
theme-options × 152
templates × 139
images × 120
widgets × 114
posts × 112
wp-query × 109
categories × 98
javascript × 97
jquery × 97
pages × 87
page-template × 83
filters × 76