Show/Hide Featured Image or replace it with custom field [closed]
I’m pretty sure you want something like this: $myfield = get_post_meta($post->ID, ‘short’, true); if ($myfield) { echo do_shortcode($myfield); } else { the_post_thumbnail(); }
I’m pretty sure you want something like this: $myfield = get_post_meta($post->ID, ‘short’, true); if ($myfield) { echo do_shortcode($myfield); } else { the_post_thumbnail(); }
Use Conditional Tags: http://codex.wordpress.org/Conditional_Tags Or a custom template for homepage: http://codex.wordpress.org/Stepping_Into_Templates Then it’s a matter of applying a style / class when, for example, is_front_page() (or sometimes) is_home() (for conditionals), or on your custom template. It’s mostly a matter of CSS then. Update/Alternative: Use Chrome to learn body class. Apply style accordingly: body.home { background:url(images/home_background.png) … Read more
Saving this data persistently seems like excessive approach. Since there is no human input (only logic), there is no benefit to storing results – just keep the logic. More so if logic changes next week you won’t need to re-save everything. Basically I would instead during output check is post has value and if not … Read more
Dropping the code quickly into my test set up, I think you are asking why your page metabox is showing your desired post meta inputs. There’s no problem with your add_meta_box() functions. The problem is with your variable $custom_meta_fields. By the time WordPress gets to the end of your file $custom_meta_fields is defined by the … Read more
The main theme css (http://www.bookelivery.in/wp-content/themes/MeetGavernWP/css/template.css?ver=3.5.2) you are using does everything through a fluid layout – so everything with percentages. Thus there’s no way to remove the responsiveness without completely changing the theme. It seems to work quite well for a mobile size, the main issue being your large title image which doesn’t resize, which is … Read more
For your purpose enqueue is the key: wp_enqueue_script() wp_enqueue_style() You can consult this question: How to enqueue the style using wp_enqueue_style() for style enqueue. For scripts enqueue I recently did as: // ENQUEUE JAVASCRIPTS FOR CUSTOM PURPOSE function scripts_for_something() { wp_register_script( ‘my-scripts’, get_template_directory_uri() . ‘/js/my-scripts.js’ ); wp_enqueue_script( ‘my-scripts’ ); } add_action( ‘admin_enqueue_scripts’, ‘scripts_for_something’ ); admin_enqueue_scripts … Read more
private function createWooComSubscription($user_id, $product_name, $total, $payment_id) { $arr = explode(“-“, $product_name); $product_title = trim($arr[0]); $product_subscription = trim($arr[1]); $product = $this->getWooComProduct($product_title); if ($product == null) { $this->getController()->log(“Product not found ! woo com create subscription failed”); return; } $variation = $this->getWooComVariation($product, $product_subscription); if ($variation == null) { $this->getController()->log(“Variation not found ! woo com create subscription failed”); return; … Read more
There are a lot of slider pluglins in wordpress repository such http://wordpress.org/plugins/slide-show-pro/, just follow the install steps. then use the shortcodes like [slideshowpro cats=2,3] or the code to integrate into php php echo do_shortcode(‘[slideshowpro cats=2,3]’); insert the code in header.php to show the slider on every single page or post
You didn’t close the if(isset($_POST[‘submit’]) ){ tag on line 42
The most common method is based on scroll position and if the item is visible. When it becomes visible they fire an event. Here’s an answer with a bit of code I’d check out. https://stackoverflow.com/a/488073/1251604