brandozz
  • Member for 7 years, 1 month
  • Last seen more than 1 year ago
Shortcode producing headers already sent error
Accepted answer
6 votes

The adjustment to my function below fixed the issue but I wanted to make sure that this is the right way to handle the shortcode. I've added ob_start(); and ob_get_clean(); to the function. Is this ...

View answer
Wordpress Shortcode function display outside of widget
2 votes

Solved this utilizing ob_start() and ob_end_clean via this post: Custom shortcode in widget forced to top of widget if (!function_exists('footer_get_latest_post')) { function ...

View answer
Block access to wp-admin
Accepted answer
2 votes

Placing the htaccess file in the wp-admin directory did not work for me so I went a different route and it seems to be working very well. Below is what I have in my main htaccess file: <files wp-...

View answer
Theme logo metadata into template file
1 votes

Ends up that "alt" is not stored in wp_get_attachment_metadata so I pulled it from the post meta: $custom_logo_id = get_theme_mod('custom_logo'); if ($custom_logo_id) { $image = ...

View answer
Select pages by category
1 votes

I was able to work this out thanks to the following post How to Add Categories to Pages in Wordpress. I needed to modify WP_query to include pages when displaying a list of posts. Below is the ...

View answer
Force a 403 response to xml file in Wordpress
0 votes

The fix that worked was adding an htaccess file to the directory with the line below ErrorDocument 403 default

View answer
Echo Category In Loop
0 votes

Are the opening and closing php tags for the product_cat arg killing the statement? Would this work: $clothing = get_theme_mod('vatname', 'Clothing'); $args = array( 'post_type' => 'product', ...

View answer
Division by zero error in image.php
0 votes

The error is being generated on image attachment pages, so this is most likely a bot. But I added a check before the shutter speed is converted to a fraction: $imgmeta = wp_get_attachment_metadata( $...

View answer
WordPress script file version numbers changing in live environment
0 votes

The WordPress plugin Wordfence(ver. 6.0.22) was causing this issue. To fix this, go to "Options" and uncheck "Hide WordPress Version".

View answer
WordPress Multisite redirect loop
Accepted answer
0 votes

Applying the htaccess for version 3.5+ seems to have worked RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ ...

View answer