Function Suddenly Stopped Working

Here is your problem: “options” => array(“Next/Previous Links”, “Pagination”), “std” => “Next” Your valid options don’t match your default. Change this: “std” => “Next” …to this: “std” => “Next/Previous Links” Then, in your function call, change this: if( get_option( $shortname . ‘_next_prev_or_paginate’ ) == ‘Next’ ) …to this: if( get_option( $shortname . ‘_next_prev_or_paginate’ ) == … Read more

Custom metabox not working

Problem #1: First problem: inside home-meta.php, pull all of your add_meta_box() calls outside of the add_meta_boxes_home() callback, and get rid of the callback and add_action() call. You handle this already, with the add_meta_boxes_page callback in functions.php, that includes home-meta.php. Problem #2: Warning: Invalid argument supplied for foreach() in /Users/[my_mac]/Sites/[site_dir]/wp-content/themes/[site_theme]/metaboxes/home-meta.php on line 224 Assuming that this … Read more

Featured Image keeps cropping

add_action( ‘wp_enqueue_scripts’, ‘brian_scripts’ ); if ( function_exists( ‘add_theme_support’ ) ) { add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size( 214, 9999, false ); add_image_size(‘large’, 500, 9999, true); //custom size } This code is in your functions.php? The docs for add_theme_support() suggest to only use it in the functions.php of the theme or attach it to the after_setup_theme hook. Also … Read more

Excerpt length: get first paragraph

Assuming your paragraphs are marked with <p> tags, which can be set in the ACF field options, the following should work: function custom_field_excerpt() { global $post; $text = get_field(‘news’); if ( ” != $text ) { $start = strpos($text, ‘<p>’); // Locate the first paragraph tag $end = strpos($text, ‘</p>’, $start); // Locate the first … Read more

Overwriting TwentyTwelve template file with child theme template, but lower in the hierarchy

This is minimally tested– nearly untested really– but: function force_archive_php_wpse_88824() { if (is_main_query() && is_archive()) { include (get_stylesheet_directory().’/archive.php’); exit; } } add_action(‘template_redirect’,’force_archive_php_wpse_88824′); You are interrupting the template load process and forcing a file of your choice to be used. Reference http://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect http://codex.wordpress.org/Function_Reference/get_stylesheet_directory

Have h2 tag not show up if there are no blog posts

Put your <h2> tag after the call to get_related_author_posts(). For example… $rap = get_related_author_posts(); if (!empty($rap)) { echo ‘<h2>Recent Blog Articles</a></h2>’; // <- broken anchor tag !!! echo $rap; // and so on } But you will need to make get_related_author_posts() return false if there are no posts. function get_related_author_posts() { global $authordata, $post; $authors_posts … Read more

Taxonomy archive template not working

You have a taxonomy name Talks, this must be lowecase (talks). If you look at the register_taxonomy() Codex page the following parameter description is shown: <?php register_taxonomy( $taxonomy, $object_type, $args ); ?> $taxonomy (string) (required) The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces) and not … Read more

How to setup a popup registeration page in wordpress with function.php

You can add the HTML for the area via wp_footer, include the style with wp_enqueue_style(), and include the javascript to show/hide the popup with wp_enqueue_script(). wpse90382_popup_function() { add_action( ‘wp_footer’, ‘wpse90382_popup_html’ ); wp_enqueue_style( ‘your_style’, get_template_directory_uri() . ‘your_stylesheet.css’ ); wp_enqueue_script( ‘your_script’, get_template_directory_uri() . ‘your_javascript.js’ ); } wpse90382_popup_html() { ?> <div>Your HTML</div> <?php } if ( some condition … Read more