Hot answers tagged

5

It turns out that the ThemeWoot Emulate theme registers and enqueues a common.css file with the key of common in it's themewoot.php (which is being included in functions.php). This key is apparently conflicting with a wp-admin script being registered with the same common key, and so, instead of including Emulate's common.css, it's enqueuing and injecting ...


4

You can use sprintf: echo sprintf( __('Follow %s on Facebook', 'yanse'), get_bloginfo('name') );


3

You've touched on a few things here, and there's both the server and the frontend response time that you're battling with. You might have issues with both. It's worth noting firstly that PageSpeed (and the style recalcuating alert in the Chrome timeline) both deal with front-end aspects only - in slightly different ways though (another good tool to check ...


3

Sidebars are stored in global variable $wp_registered_sidebars. You can get the sidebar properties using this variable. global $wp_registered_sidebars; if ( isset( $wp_registered_sidebars['sidebar-2'] ) ) { echo $wp_registered_sidebars['sidebar-2']['name']; } Note that do not use it too early, either on/after widgets_init hook or in a template ...


2

You may want to look at the TwentySixteen theme, which does it this way: In single.php: get_template_part( 'template-parts/content', 'single' ); Several templates are grouped in the 'template-parts' folder. You could use a similar logic for your custom post type. It seems that the technique comes from _underscores.


1

$all_the_images = get_attached_media( 'image', 31 ); should return any image attachments for a page the ID of 31 if that page has child images. Meaning, there are images that were uploaded and actually attached to that page, not just upload and inserted into that page. When you use the media uploader (to upload images), from within the Edit screen of the ...


1

I would consider this not really a typical WP question – maybe you should ask over at http://unix.stackexchange.com – but maybe this could already help anyways: If you have access to the server config and you know the IP address of FB Instant Articles and Apple News you could for example block everybody from accessing your feed – but allow FB Instant ...


1

This is a shot in the dark because I can't see the site... Check the way your theme uses css to align your sidebar and see if the width that is being set to the div by the user is causing the post container to become too wide, pushing the sidebar down. You could use some css to control elements within the posts container such as: I would try to find the ...


1

I am not sure about "popular", it doesn't seem so to me (but then I don't look at that many themes). You seem to grasp fine what each conditional does, so this shouldn't be confusing to you. This combines conditions to check that blog index is being displayed and it's not at the front page. Ah, the reason for single_post_title() I would guess is that it ...


1

This will display the title of the page when a static page is set to show posts. e.g. I show posts on my homepage... It'll do nothing. If I, say, show posts on page titled News... It'll show News in H1 This is used so that title of the page is shown, whenever posts are shown on a page but nothing when blog posts are shown on front page (home page). We ...


1

Well it turns out Apple News doesn't accept password-protected RSS feeds. Thanks for the help!


1

If you have successfully uploaded the theme via FTP into the correct directory it should be available to activate. Things to check: Using your FTP client, you should be able to see the theme directory and all its files under wp_content/themes Make sure the file permissions are correct for WordPress to be able to access the files (you may need to check ...


1

Any extra code on your server is a theoretical security risk. Instead of checking each plugin and theme if they are security risk even if they are not active, it is much easier to just delete them. This of course should not prevent you from backuping them first in case you will decide that you need them in the future ;)


1

I agree with @Zlatev that you probably wouldn't want to do this clientside. There are easier ways to include less. There are plugins that allow you to do this. Even jetpack has less support. If your goal is to include this in your theme you can use wp-less. Just download that plugin and drop in somewhere in your theme and include it in your ...


1

By the sounds of it, your custom theme is missing the common hooks that allow plugins to alter/output their code. To take a simple example, every theme should have a call to wp_head() somewhere in the section of the output page. This allows a plugin to "hook" into your , and for example, output code to load its Javascript. Here's a real-life example. The ...


1

Your child theme functions.php loads before the parent theme's, so you're trying to remove the action before it's added by the parent theme. Hook after_setup_theme to remove/add, which is executed after both child and parent load. add_action( 'after_setup_theme', 'wpd_wp_head_function' ); function wpd_wp_head_function() { remove_action( 'wp_head', ...



Only top voted, non community-wiki answers of a minimum length are eligible