Chris Huff
Forum Replies Created
-
Forum: Plugins
In reply to: [Auto Featured Image from Title] Warning ErrorI’ve tested with multisite so that shouldn’t be the issue. I’m out of town right now, but I’ll try to troubleshoot this error when I get home in a couple days.
Forum: Hacks
In reply to: Sharing Unknown image on FacebookFacebook uses the image specified as the og:image. If no og:image is specified, it tries its best to pick the image (usually the first one in the content) that best represents the page being shared. Of course, when an og:image is not specified, Facebook often gets it wrong.
So the best way is to specify an og:image. Some plugins will do this using the featured image. Some will allow you to specify an og:image for each post. I use SEO Ultimate for this purpose.
What’s the page you’re trying to share? I could take a look at the code and try to determine the cause.
Forum: Hacks
In reply to: Centering location of header with-in codeThis might work for you. Add this to the bottom of your theme’s style.css file:
@media only screen and (max-width: 736px) { .between-header{ display:inline; float:none; text-align:center; margin-left:0px; } }This should reset and fix the css for most mobile phones, but not for tablets, which should generally show the full website.
Look in content-single.php
By the way, when you post code, put it between backticks in order to preserve the code, so that none get stripped away.
Found and fixed the problem with the background color (and a couple other bugs). Update to the new version of the plugin, and let me know if you experience any more issues.
Thanks for the bug report. I’ll look into it today and hopefully release an update with a fix very soon.
Forum: Themes and Templates
In reply to: [Edin] Page background image.If your theme has a single.php file, edit it and remove this code:
the_post_thumbnail();Forum: Themes and Templates
In reply to: How to link featured image to postTry this. In the template-parts/content.php file, change this:
echo '<div class="post-thumbnail">'; the_post_thumbnail( 'large-thumb' ); echo '</div>';To this:
echo '<div class="post-thumbnail"><a href="' . get_permalink() . '">'; the_post_thumbnail( 'large-thumb' ); echo '</a>'; echo '</div>';Forum: Hacks
In reply to: What's wrong with this conditional statementTry using the post ID instead of the slug.
Forum: Themes and Templates
In reply to: Remove featured image from post?When you post code here on the WordPress forums, make sure you put your code between backticks (highlight the code and click “code” above the textarea). That way none of the code is stripped out.
Since your single.php uses get_template_part(), we need to look into another file to find the featured image code. Does your theme have a loop-single.php? Or maybe just loop.php? Post its code here, and it should have the featured image code in it.
Forum: Hacks
In reply to: Can you move the default position of the Featured Image meta box up?I’m really not sure, and it’s really confusing me, too. I thought that when I originally tried it, it worked, but now it’s not removing the original featured image meta box for me, either. So either I never really had it working the first time, or I changed the code somehow before posting it here. But I’m glad it’s working for you now, at least!
Forum: Hacks
In reply to: Can you move the default position of the Featured Image meta box up?Take out all the code we added so far, and just try this instead:
function add_metaboxes(){ add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', 'post', 'side', 'high'); } add_action( 'add_meta_boxes', 'add_metaboxes' );This will attempt to simply move the default featured image meta box to the top, without removing it first.
Forum: Themes and Templates
In reply to: Remove featured image from post?This is usually done in your theme’s single.php file. The code pertaining to the featured image will look something like this:
<?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail(); } ?>If you have a single.php file, you could post its code here and I’ll track down the code you need to remove to remove the featured image from the posts.
Forum: Hacks
In reply to: How to determine the number of entries in a fieldTry this.
<?php if(get_field('prevention')){ $prevention_array = array(); while(has_sub_field('prevention')){ $prevention_array[] = get_sub_field('prevention_method'); } $i = count($prevention_array); if($i==1){ the_sub_field('prevention_method'); } else{ echo '<ul>'; foreach ($prevention_array as $prevention_method) { echo '<li>' . $prevention_method . '</li>'; } echo '</ul>'; } } ?>I think the problem was that I was trying to create an array with the_sub_field() when I should have used get_sub_field(), so that it didn’t immediately echo as output. Let me know if that works.
Forum: Hacks
In reply to: How to determine the number of entries in a fieldSo, just to be clear, is the output of my code something like this?
Prevention Method 1 <ul></ul> Prevention Method 2 Prevention Method 3 Prevention Method 4 Prevention Method 5