• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

ollyrichards

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 10, 2015 at 3:46 am in reply to: custom text on category page #147289
    ollyrichards
    Member

    Hi,

    That's what I tried first, but it doesn't display. Like I mentioned above, I tried following this tutorial to get it to work, but to no avail: http://mygenesisthemes.com/category-description-genesis/

    Does anyone else have experience with this?

    May 31, 2014 at 6:45 am in reply to: Generate box welcome page #107621
    ollyrichards
    Member

    Hadn't come across that tool - thanks!

    Here you go: https://gist.github.com/anonymous/8d652f3fa109c335624b

    May 30, 2014 at 11:07 pm in reply to: Generate box welcome page #107579
    ollyrichards
    Member

    Thanks for your reply, still a little lost though.

    Here's the code for the plugin.php, and following that for the widget.php. Can you tell me which part of the code is (or should be) directing to the thank you page?

    Many thanks

    <?php

    /*
    Plugin Name: Genesis Simple Aweber Form
    Plugin URI: http://DesignsByNicktheGeek.com
    Version: 0.1
    Author: Nick_theGeek
    Author URI: http://DesignsByNicktheGeek.com
    Description: Allows Aweber form to be used in place of the eNews and Updates widget
    Text Domain: gsaf
    Domain Path /languages/
    */

    /*
    * To Do:
    * Create and setup screen shots
    */

    /** Load textdomain for translation */
    load_plugin_textdomain( 'gsaf', false, basename( dirname( __FILE__ ) ) . '/languages/' );

    define( 'GSAF_PLUGIN_DIR', dirname( __FILE__ ) );

    /* Prevent direct access to the plugin */
    if ( !defined( 'ABSPATH' ) ) {
    wp_die( __( "Sorry, you are not allowed to access this page directly.", 'gfwa' ) );
    }

    register_activation_hook( __FILE__, 'gsaf_activation_check' );

    /**
    * Checks for minimum Genesis Theme version before allowing plugin to activate
    *
    * @author Nathan Rice
    * @uses gsaf_truncate()
    * @since 0.1
    * @version 0.2
    */
    function gsaf_activation_check() {

    $latest = '1.8';

    $theme_info = get_theme_data( TEMPLATEPATH . '/style.css' );

    if ( basename( TEMPLATEPATH ) != 'genesis' ) {
    deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate ourself
    wp_die( sprintf( __( 'Sorry, you can\'t activate unless you have installed %1$sGenesis%2$s', 'gfwa' ), '', '' ) );
    }

    $version = gsaf_truncate( $theme_info['Version'], 3 );

    if ( version_compare( $version, $latest, '<' ) ) {
    deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate ourself
    wp_die( sprintf( __( 'Sorry, you can\'t activate without %1$sGenesis %2$s%3$s or greater', 'gfwa' ), '', $latest, '' ) );
    }
    }

    /**
    *
    * Used to cutoff a string to a set length if it exceeds the specified length
    *
    * @author Nick Croft
    * @since 0.1
    * @version 0.2
    * @param string $str Any string that might need to be shortened
    * @param string $length Any whole integer
    * @return string
    */
    function gsaf_truncate( $str, $length=10 ) {

    if ( strlen( $str ) > $length ) {
    return substr( $str, 0, $length );
    } else {
    $res = $str;
    }

    return $res;
    }

    // Include files
    require_once(GSAF_PLUGIN_DIR . '/widget.php');

    ------------

    <?php
    /**
    * Adds the Genesis Simple Aweber Form widget.
    *
    * @category Genesis
    * @package Widgets
    * @author Nick the Geek
    * @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
    */

    /* Prevent direct access to the plugin */
    if ( !defined( 'ABSPATH' ) ) {
    wp_die( __( "Sorry, you are not allowed to access this page directly.", 'gfwa' ) );
    }

    add_action( 'widgets_init', create_function( '', "register_widget('Genesis_Simple_Aweber_Form');" ) );

    /**
    * Genesis Simple Aweber Form Class
    * @category Genesis
    * @package Widgets
    *
    * @since 0.1
    */
    class Genesis_Simple_Aweber_Form extends WP_Widget {

    /**
    * Holds widget settings defaults, populated in constructor.
    *
    * @var array
    */
    protected $defaults;

    /**
    * Constructor. Set the default widget options and create widget.
    */
    function __construct() {

    $this->defaults = array(
    'title' => '',
    'text' => '',
    'id' => '',
    'name_text' => '',
    'input_text' => '',
    'button_text' => '',
    'thank_you' => 'text',
    'custom_url' => '',
    );

    $widget_ops = array(
    'classname' => 'enews-widget',
    'description' => __( 'Displays Aweber subscribe form', 'gsaf' ),
    );

    $this->WP_Widget( 'gsaf', __( 'Genesis Simple Aweber Form', 'gsaf' ), $widget_ops );

    }

    /**
    * Echo the widget content.
    *
    * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
    * @param array $instance The settings for the particular instance of the widget
    */
    function widget( $args, $instance ) {

    extract( $args );

    /** Merge with defaults */
    $instance = wp_parse_args( (array) $instance, $this->defaults );

    echo $before_widget . '<div class="enews aweber">';

    if ( ! empty( $instance['title'] ) )
    echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;

    echo wpautop( $instance['text'] ); // We run KSES on update

    if ( ! empty( $instance['id'] ) ) : ?>
    <form method="post" class="af-form-wrapper" action="http://www.aweber.com/scripts/addlead.pl" id="subscribe" target="popupwindow">
    <div style="display: none;">
    <input type="hidden" name="listname" value="<?php echo $instance['id']; ?>" />

    <?php
    if( 'custom' == $instance['thank_you'] )
    $value = $instance['custom_url'];
    else
    $value = 'http://www.aweber.com/thankyou-coi.htm?m=' .$instance['thank_you'];
    ?>

    <input type="hidden" name="redirect" value="http://www.aweber.com/thankyou-coi.htm?m=<?php echo $value ?>" id="redirect_ee2c9df8de97f9c416c33b210b47c0bc" />

    <input type="hidden" name="meta_adtracking" value="Genesis_Simple_Aweber_Form" />
    <input type="hidden" name="meta_message" value="1" />
    <input type="hidden" name="meta_required" value="name,email" />

    </div>

    <span id="subbox">
    <input type="text" name="name" class="text name" tabindex="500" value="<?php echo esc_attr( $instance['name_text'] ); ?>" onfocus="if ( this.value == '<?php echo esc_js( $instance['name_text'] ); ?>') { this.value = ''; }" onblur="if ( this.value == '' ) { this.value = '<?php echo esc_js( $instance['name_text'] ); ?>'; }" />
    <input type="text" name="email" class="text email" tabindex="501" value="<?php echo esc_attr( $instance['input_text'] ); ?>" onfocus="if ( this.value == '<?php echo esc_js( $instance['input_text'] ); ?>') { this.value = ''; }" onblur="if ( this.value == '' ) { this.value = '<?php echo esc_js( $instance['input_text'] ); ?>'; }" />
    </span>

    <input name="submit" class="submit" type="submit" value="<?php echo esc_attr( $instance['button_text'] ); ?>" tabindex="502" id="subbutton" />

    </form>
    <?php endif;

    echo '</div>' . $after_widget;

    }

    /**
    * Update a particular instance.
    *
    * This function should check that $new_instance is set correctly.
    * The newly calculated value of $instance should be returned.
    * If "false" is returned, the instance won't be saved/updated.
    *
    * @param array $new_instance New settings for this instance as input by the user via form()
    * @param array $old_instance Old settings for this instance
    * @return array Settings to save or bool false to cancel saving
    */
    function update( $new_instance, $old_instance ) {

    $new_instance['title'] = strip_tags( $new_instance['title'] );
    $new_instance['text'] = wp_kses( $new_instance['text'], genesis_formatting_allowedtags() );
    return $new_instance;

    }

    /**
    * Echo the settings update form.
    *
    * @param array $instance Current settings
    */
    function form( $instance ) {

    /** Merge with defaults */
    $instance = wp_parse_args( (array) $instance, $this->defaults );

    ?>
    <p>
    <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'genesis' ); ?>:</label><br />
    <input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" class="widefat" />
    </p>

    <p>
    <label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Text To Show', 'genesis' ); ?>:</label><br />
    <textarea id="<?php echo $this->get_field_id( 'text' ); ?>" name="<?php echo $this->get_field_name( 'text' ); ?>" class="widefat" rows="6" cols="4"><?php echo htmlspecialchars( $instance['text'] ); ?></textarea>
    </p>

    <p>
    <label for="<?php echo $this->get_field_id( 'id' ); ?>"><?php _e( 'Aweber List ID', 'gsaf' ); ?>:</label>
    <input type="text" id="<?php echo $this->get_field_id( 'id' ); ?>" name="<?php echo $this->get_field_name( 'id' ); ?>" value="<?php echo esc_attr( $instance['id'] ); ?>" class="widefat" />
    </p>

    <p>
    <?php $name_text = empty( $instance['name_text'] ) ? __( 'Name', 'gsaf' ) : $instance['name_text']; ?>
    <label for="<?php echo $this->get_field_id( 'name_text' ); ?>"><?php _e( 'Name Text', 'gsaf' ); ?>:</label>
    <input type="text" id="<?php echo $this->get_field_id( 'name_text' ); ?>" name="<?php echo $this->get_field_name( 'name_text' ); ?>" value="<?php echo esc_attr( $name_text ); ?>" class="widefat" />
    </p>

    <p>
    <?php $input_text = empty( $instance['input_text'] ) ? __( 'Enter your email address...', 'genesis' ) : $instance['input_text']; ?>
    <label for="<?php echo $this->get_field_id( 'input_text' ); ?>"><?php _e( 'Input Text', 'genesis' ); ?>:</label>
    <input type="text" id="<?php echo $this->get_field_id( 'input_text' ); ?>" name="<?php echo $this->get_field_name( 'input_text' ); ?>" value="<?php echo esc_attr( $input_text ); ?>" class="widefat" />
    </p>

    <p>
    <?php $button_text = empty( $instance['button_text'] ) ? __( 'Go', 'genesis' ) : $instance['button_text']; ?>
    <label for="<?php echo $this->get_field_id( 'button_text' ); ?>"><?php _e( 'Button Text', 'genesis' ); ?>:</label>
    <input type="text" id="<?php echo $this->get_field_id( 'button_text' ); ?>" name="<?php echo $this->get_field_name( 'button_text' ); ?>" value="<?php echo esc_attr( $button_text ); ?>" class="widefat" />
    </p>

    <p>
    <label for="<?php echo $this->get_field_id( 'thank_you' ); ?>"><?php _e( 'Thank You Page', 'gfsa' ); ?>:</label>
    <select id="<?php echo $this->get_field_id( 'thank_you' ); ?>" name="<?php echo $this->get_field_name( 'thank_you' ); ?>">
    <option value="text" <?php selected( 'text', $instance['thank_you'] ); ?>><?php _e( 'Basic Version', 'gfsa' ); ?></option>
    <option value="audio" <?php selected( 'audio', $instance['thank_you'] ); ?>><?php _e( 'Audio Version', 'gfsa' ); ?></option>
    <option value="video" <?php selected( 'video', $instance['thank_you'] ); ?>><?php _e( '"Smart" Video Version', 'gfsa' ); ?></option>
    <option value="custom" <?php selected( 'custom', $instance['thank_you'] ); ?>><?php _e( 'Custom Page', 'gfsa' ); ?></option>
    </select>
    </p>

    <p>
    <label for="<?php echo $this->get_field_id( 'custom_url' ); ?>"><?php _e( 'Custom URL', 'gsaf' ); ?>:</label>
    <input type="text" id="<?php echo $this->get_field_id( 'custom_url' ); ?>" name="<?php echo $this->get_field_name( 'custom_url' ); ?>" value="<?php echo esc_attr( $instance['custom_url'] ); ?>" class="widefat" />
    </p>

    <?php
    }

    }

    December 6, 2013 at 5:47 am in reply to: Change Generate Box "Join Us" image #77340
    ollyrichards
    Member

    Thanks - where can I find that code?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble