I have a WordPress network with multiple sites using the same theme. Now I need to edit part of a certain PageTemplate.php to display different things based on the...
I have a custom post type for a group of people (employees). At first, I needed to display 7 random employees. That was easy <?php $args = array( 'post_type'...
I just need to say in single.php if post type = x then display y. Else, don’t display it. 3 Answers 3 if( get_post_type() == 'post_type_slug' ) { //do...
I would like to place content in a sidebar of my blog articles when they are viewed in the archive, but not show this content when the blog articles...
I would like to add some code in functions.php that does this: If the first paragraph contains an image, show my custom code right AFTER it. For example: <div...
I have one “branch” of my main site’s navigation tree that should only be accessible to a set of registered, logged-in users. I understand how to query a user’s...
As far as I know, there’s not a simple function that will return true if a post has an attachment. With that in mind, what’s the best way to...
This is the code im using in my functions file: add_action('init', 'sort_out_jquery_pngfix_frontend'); function sort_out_jquery_pngfix_frontend() { global $wp_scripts; if(!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', array(), NULL, true); wp_register_script('dd_belatedpng', get_stylesheet_directory_uri() . '/js/dd_belatedpng.js',...
I’m trying to create a conditional statement for the content width in the functions.php of my theme. So some categories will have a content_width of 580, some will have...
Before I get started, I want to acknowledge that there are some really good articles that are targeted at how to conditionally enqueue scripts based on page/post content. WordPress...