How can I hide Home in my menu in a specific page?
WordPress adds a unique class for each page in the body tag, you can use that class to target specific elements on your page through CSS. .page-id-32 .menu-item-31 {display:none;}
WordPress adds a unique class for each page in the body tag, you can use that class to target specific elements on your page through CSS. .page-id-32 .menu-item-31 {display:none;}
Use the second parameter of wp_get_attachment_image_src(): $size. $att = wp_get_attachment_image_src( $att_ID, ‘large-thumb’ ); or $att = wp_get_attachment_image_src( $att_ID, array ( 900, 300 ) ); The size is passed to image_downsize() and there to image_get_intermediate_size(). If $size is an array WordPress will search for the best match in existing images: // from wp-includes/media.php::image_get_intermediate_size() // get the … Read more
I guess you’re talking about a site specific wp-config.php file that resides in your themes folder. At the point where you’re loading the wp-config.php file, WP isn’t fully loaded, so you ain’t got any constants or filesystem API or other basic API functions available. Here’s how I approach this: Structure # Dir structure ~/ROOT ├── … Read more
Check for the post type with the post ID: if ( $post[‘post_id’] && get_post( $post[‘post_id’] ) && ‘post’ === get_post_type( $post[‘post_id’] ) )
The better, cleaner solution would be not to use custom page templates to define page layouts*, but rather to use custom post meta to define page layouts. To implement: Create a Theme Option for Default static page layout, that includes all possible page layout options Create a _page_layout custom post meta for Page Layout, that … Read more
You can use get_the_category() and return the first result as in the example. Technically you could have several parent categories so you need to deal with this separately or expect that the first element of the array is always the right parent category.
var_dump($paths); shows that the your $paths variable is an empty string. It’s not showing anything because there is nothing to show. Since you seem like you’re trying to find all the plugins, you should have a look at get_plugins. glob is going to be relative to the current working directory (with will vary depending on … Read more
I have integrated buttons to TinyMCE with WordPress functionality, let me know if this material would add some context with code samples to your use case.
Basically what you’re looking to do is create a separate page within a WordPress site that (I’m sort of guessing here) you’re not creating within WordPress itself, but you want to pull WordPress data. There’s a “cheater” method and an officially sanctioned method to do what you want. The “cheater” method is to call wp-load.php … Read more
If you want to alter display based on admin options, you don’t need to deal at all with the shortcode_atts ar the $attributes that are passed into your callback. The attributes passed in (and set by shortcode_atts) are meant to alter the way a shortcode works based on how an end-user uses it. Take this: … Read more