Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

Christine357 on "twentytwelve_entry_meta() Change"

0
0

Hey guys I am trying to change the following function just to reword how it displays the entry_meta for posts:

function twentytwelve_entry_meta() {
	// Translators: used between list items, there is a space after the comma.
	$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );

	// Translators: used between list items, there is a space after the comma.
	$tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );

	$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
		esc_url( get_permalink() ),
		esc_attr( get_the_time() ),
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() )
	);

	$author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
		esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
		get_the_author()
	);

	// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
	if ( $tag_list ) {
		$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
	} elseif ( $categories_list ) {
		//$utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
		$utility_text = __( '%3$s | by %4$s || in %1s' );
	} else {
		$utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
	}

	printf(
		$utility_text,
		$categories_list,
		$tag_list,
		$date,
		$author
	);
}
endif;

I've learned in the past it is not as simple as paste the function into your child theme php file but the use of filters is required. I read the documentary after looking at a couple other functions I had help putting in before but I still don't really understand what I need to do to make my change to the above function and so am hoping someone could help me out. :) Eventually I'll get it.


user256 on "Twentyfourteen two columns"

0
0

I'm trying to turn the blog on twentyfourteen into a two column layout, not sure where i'm going wrong. Any tips

Cheers

mariz_p on "add user notification in bbpress moderation"

0
0

I have modified the bbpress moderation plugin since I'm not getting any response from it's author.
Please see this link: http://pastebin.com/EMmZK1Zt
for my code.

Now, my problem is I cannot make it work. I have checked the structure of wp mail and I know I'm in the right path. It's just why it's still not working.

I hope someone here can help me as I've been struggling on this for months now.

Thanks and have a great day ahead.

Best regards,
Mariz

John on "Adding custom button code to a simple lightbox link"

0
0

My question,

I am trying to add a custom button to a simple lightbox link

If you look at the link below and switch to LIST VIEW(look at the second listing called "Drag and Drop") you can see the button is rendering but the words that are supposed to be on the button are next to it and not on the button.

http://www.johnpendleton.com/jpportfolio/portfolio/#prettyPhoto

Code that I am using for the button:

a href="http://www.johnpendleton.com/jpportfolio/wp-content/uploads/2013/10/parallax-background-quasar.jpg" rel="prettyPhoto" title="This is the description"><img src="[rockthemes_button icon_align="left" icon_title="View Larger Image" button_size="" button_color="primary" button_flat="no" button_shape="button-rounded" button_wrap="no" link_url="" icon_class="icon-check" icon_url=""]View Larger Image[/rockthemes_button]" />

Any help on what I need to change to get this to work would be great!

Thanks,

JP

MarkLidstone on "Adding Image to end of last line"

0
0

Hey Gang, maybe you can help me. I'm trying to add a tiny image to the end of the very last line of a post. I've got the function built so the image appears after each post, but my problem is, it appears on the next line and I can't for the life of my get it on the same line.

Here's my function

function new_default_content($content) {
global $post;
    if ($post->post_type == 'blog') {
    $content .= '<p class="sig"><img src="url/images/LM.jpg"  /></p>';
    }
    return $content;
    }
add_filter('the_content', 'new_default_content');

And I'm getting this type of result:

This is the end of the post
[image]

But I want

This is the end of the post [image]

Any help would be greatly appreciated. It's driving me bonkers.

Feyisayo1 on "How To Create Plugin For My Theme"

0
0

Hi, my wordpress website has really been giving my visitors mobile optimization issues that I had to get a mobile theme specifically for mobile users.

Now, the problem I'm having is the shortcodes in my desktop theme are rendering as plain text which is bound to happen since they are different themes.

I read somewhere that creating a plugin for my site was the best solution to this problem, but I'm still very new to wordpress php coding and stuff. I already created a php file but what codes from my desktop theme do I have to add to my plugin's php file to make it render the shortcodes from my desktop's theme properly in my mobile theme?

Piotr on "Looping posts with content from different database"

0
0

Hello,

My problem is a bit complicated, but I'm kind of new to WordPress and I'm still learning PHP, so maybe I can't see the solution yet.

Here's my situation. I'm running a community forum on which I have a news section. I would like to have a CMS that takes posts from that section and displays them on a website just as most blogs do - with categories, tags and so on, and I think it can be achieved with WordPress (actually I'm almost sure it can, but I'm missing some knowledge to figure out how exactly). I've read a lot of tutorials, which gave me some ideas.

To do this, I would have to connect to the forum database and get post data from a table or tables. I tried using wpdb class (new wpdb in my child theme functions, it works great), but is it possible to put this data in a WordPress loop using WP_query? Doing it this way would let me use template tags and give me all the goodness of WordPress (permalinks, search, archives?), the problem is, can the WP_query be used or modified to get certain columns from certain tables in a different database, and treat it as usual post data?

If yes, great, if no, I have a second idea - copying certain forum columns into a separate table in wordpress database and using that data for custom posts. Probably this would be better, but I'm worried about the number of connections to the forum database - is there a way to copy and update this data periodically or when certain tables are updated (like when a new news-topic is published or edited)? Because in the previous case I was hoping that some kind of caching plugin in WordPress would solve it, but here... I'm not so sure.

One thing to note - I'm not thinking about editing these posts in WordPress, I don't need to do anything with them (although some parsing will be needed, but that is next on my "learn how to do it" list, if this works out), I just need a one way connection.

So... this is it. I was hoping more experienced users can give me advice and point me in the right direction - I would be very grateful for that. Thanks for anything you can share.

lwynne on "Adding More than One Custom Settings Field"

0
0

I am using the code below to add an extra field in my settings. I am attempting to add a second field (while keeping the first) and I'm unsure what the proper way to do so is. Any help?

add_filter('admin_init', 'my_general_settings_register_fields');

function my_general_settings_register_fields()
{
    register_setting('general', 'my_field', 'esc_attr');
    add_settings_field('my_field', '<label for="my_field">'.__('My Field' , 'my_field' ).'</label>' , 'my_general_settings_fields_html', 'general');

}

function my_general_settings_fields_html()
{
    $value = get_option( 'my_field', '' );
    echo '<input type="text" id="my_field" name="my_field" value="' . $value . '" />';
}

Odai Athamneh on "Widget Options Saved, But Not Displaying On Site"

0
0

I'm fairly new to WordPress development. I created a simple plugin that displays author info as a sidebar widget when viewing a single post.

I've been working on an update, trying to add options to the widget. Here's the code (sorry for length):

<?php
;/*
Plugin Name: Odai Author Widget
Plugin URI: http://odai.me/author-widget/
Description: Widget that displays the current post author's Gravatar photo, name, website, and biography.
Version: 1.0.0
Author: Odai
Author URI: http://odai.me
License: GPLv2
*/

//establish the widget
add_action( 'widgets_init', 'odai_author_widget_register' );

function odai_author_widget_register() {
	return register_widget( 'OdaiAuthorWidget' );
	}

class OdaiAuthorWidget extends WP_Widget {

	function __construct() {
		parent::__construct('odai_author_widget_', 'Odai Author Widget', array('description' => __( "Displays post author's Gravatar photo and biographical info", 'text_domain' ),) );
	}

	function widget () {
		$title = get_option('odai_aw_title', 'About the Author');
		$odai_aw_pic_size = 96;

		if(is_single()) {
		?>
		<aside id="odai-author-widget" class="widget">
		<h3 class="widget-title"><?php echo $title; ?></h3>
		<?php get_avatar(get_the_author_meta('user_email'), $odai_aw_pic_size); ?>
		<br />Name:&nbsp;<?php get_the_author_meta('display_name'); ?>
		<br />Website:&nbsp;<a href="<?php get_the_author_meta('user_url'); ?>"><?php get_the_author_meta('user_url'); ?></a>
		<p><?php get_the_author_meta('description'); ?></p>
		</aside>
		<?php
		}
	}

	function update($newinstance,$oldinstance) {
		$instance =  $oldinstance;
    		$instance['odai_aw_title'] =  $newinstance['odai_aw_title'];
    		return $instance;
	}

	function form ($config) {
		?>
    		<label for='<?php echo $this->get_field_id("title");  ?>'>
    		<p>Title: <input type="text"  value="<?php echo $config['title']; ?>" name="<?php echo $this->get_field_name('title'); ?>" id="<?php echo $this->get_field_id('title') ?>"></p>
    		</label>
		<?php
	}
}

//adding options to the database
register_activation_hook( __FILE__, 'odai_aw_add_options' );
register_deactivation_hook( __FILE__, 'odai_aw_remove_options' );

function odai_aw_add_options () {
		update_option('title', 'About the Author');
	}

function odai_aw_remove_options () {
		delete_option('title');
	}

So right now, I'm just trying to get the title option working. The form is there, I can save a new title (changes in the widget admin area), but on the website itself, it continues to display the default "About the Author" text. What am I doing wrong?

Also, feel free to suggest improvements to any aspect of the code - I'm sure it's far from perfect, as I've been learning as I go.

weirdrat on "how to eliminate google-fonts totally"

0
0

hi, can anyone please help a non-scripter like me to get totally rid of google-cloud-fonts in the wordpress-hardcode ? Not only deactivate them - I found several scripts for this - but what do I have to cancel from the wordpress basic code to eliminate any google-connection like if it never had existed .. and other question: are there still enough "normal" self hosted fonts inside ? I saw that even the dashboard now uses this google-crap and want my normal fonts like arial, helvetica, verdana etc back and dont want to leave a trace of this spy-crap google - and please I do not need any advices how useful google fonts are etc - I just want to get rid of them .. thanks a lot in advance .. the rat

olddocks on "Issues with select box in options page?"

0
0

i am trying to use selected() function in my select box, inside my wordpress theme options page. The problem is with numbers it works but it is not working comparing strings. Note that below if nothing is selected, automatically default is selected in the select box

Theme Style <select name="corpocrat-options[theme-style]">
  <option value="" <?php selected($corpocrat_options['theme_style'],""); ?>>Default</option>
  <option value="black" <?php selected($corpocrat_options['theme_style'],"black"); ?>>Black</option>
  <option value="blue" <?php selected($corpocrat_options['theme_style'],"blue"); ?>>Blue</option>
  <option value="grey" <?php selected($corpocrat_options['theme_style'],"grey"); ?>>Grey</option>
  <option value="grunge" <?php selected($corpocrat_options['theme_style'],"grunge");  ?>>Grunge</option>
</select>

lwynne on "Automatic Page Generation Error"

0
0

I use the code below to generate a page called 'Disclaimer' if there is currently not a disclaimer page on the blog. This code works well. The problem is that if a user deletes the 'Disclaimer' page, this code will generate the page multiple times over again.

I'm curious how to prevent this from happening by making it so the page cannot be deleted. Preferably, when a user deletes the page a dialog box of some sort would pop-up which would say "This page cannot be deleted."

Is this possible?

// If there is no disclaimer, generate one from its template
$disclaimer_query = new WP_Query(array(
    'pagename' => 'disclaimer',
    'post_type' => 'page',
    'post_status' => 'publish',
    'posts_per_page' => 1,
));
if (! $disclaimer_query->post_count)
    wp_insert_post(array(
        'post_name' => 'disclaimer',
        'post_title' => 'Disclaimer',
        'post_status' => 'publish',
        'post_type' => 'page',
        'post_author' => 1,
        'page_template' => 'page.php',
    ));
unset($disclaimer_query);

Eliot Akira on "Show custom post types in dashboard activity widget"

0
0

Here's how I got to show custom post types in the dashboard activity widget.

  • Copied & pasted the function wp_dashboard_recent_posts (from wp-admin/includes/dashboard.php)
  • Changed it slightly to pass post_type in the argument
  • Replaced the activity widget with one that calls the new function

The following can be put in functions.php or a plugin.

/**
 *
 * Show custom post types in dashboard activity widget
 *
 */

// unregister the default activity widget
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
function remove_dashboard_widgets() {

    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);

}

// register your custom activity widget
add_action('wp_dashboard_setup', 'add_custom_dashboard_activity' );
function add_custom_dashboard_activity() {
    wp_add_dashboard_widget('custom_dashboard_activity', 'Activities', 'custom_wp_dashboard_site_activity');
}

// the new function based on wp_dashboard_recent_posts (in wp-admin/includes/dashboard.php)
function wp_dashboard_recent_post_types( $args ) {

/* Chenged from here */

	if ( ! $args['post_type'] ) {
		$args['post_type'] = 'any';
	}

	$query_args = array(
		'post_type'      => $args['post_type'],

/* to here */

		'post_status'    => $args['status'],
		'orderby'        => 'date',
		'order'          => $args['order'],
		'posts_per_page' => intval( $args['max'] ),
		'no_found_rows'  => true,
		'cache_results'  => false
	);
	$posts = new WP_Query( $query_args );

	if ( $posts->have_posts() ) {

		echo '<div id="' . $args['id'] . '" class="activity-block">';

		if ( $posts->post_count > $args['display'] ) {
			echo '<small class="show-more hide-if-no-js"><a href="#">' . sprintf( __( 'See %s more…'), $posts->post_count - intval( $args['display'] ) ) . '</a></small>';
		}

		echo '<h4>' . $args['title'] . '</h4>';

		echo '<ul>';

		$i = 0;
		$today    = date( 'Y-m-d', current_time( 'timestamp' ) );
		$tomorrow = date( 'Y-m-d', strtotime( '+1 day', current_time( 'timestamp' ) ) );

		while ( $posts->have_posts() ) {
			$posts->the_post();

			$time = get_the_time( 'U' );
			if ( date( 'Y-m-d', $time ) == $today ) {
				$relative = __( 'Today' );
			} elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
				$relative = __( 'Tomorrow' );
			} else {
				/* translators: date and time format for recent posts on the dashboard, see http://php.net/date */
				$relative = date_i18n( __( 'M jS' ), $time );
			}

 			$text = sprintf(
				/* translators: 1: relative date, 2: time, 4: post title */
 				__( '<span>%1$s, %2$s</span> <a href="%3$s">%4$s</a>' ),
  				$relative,
  				get_the_time(),
  				get_edit_post_link(),
  				_draft_or_post_title()
  			);

 			$hidden = $i >= $args['display'] ? ' class="hidden"' : '';
 			echo "<li{$hidden}>$text</li>";
			$i++;
		}

		echo '</ul>';
		echo '</div>';

	} else {
		return false;
	}

	wp_reset_postdata();

	return true;
}

// The replacement widget
function custom_wp_dashboard_site_activity() {

    echo '<div id="activity-widget">';

    $future_posts = wp_dashboard_recent_post_types( array(
        'post_type'  => 'any',
        'display' => 3,
        'max'     => 7,
        'status'  => 'future',
        'order'   => 'ASC',
        'title'   => __( 'Publishing Soon' ),
        'id'      => 'future-posts',
    ) );

    $recent_posts = wp_dashboard_recent_post_types( array(
        'post_type'  => 'any',
        'display' => 3,
        'max'     => 7,
        'status'  => 'publish',
        'order'   => 'DESC',
        'title'   => __( 'Recently Published' ),
        'id'      => 'published-posts',
    ) );

    $recent_comments = wp_dashboard_recent_comments( 10 );

    if ( !$future_posts && !$recent_posts && !$recent_comments ) {
        echo '<div class="no-activity">';
        echo '<p class="smiley"></p>';
        echo '<p>' . __( 'No activity yet!' ) . '</p>';
        echo '</div>';
    }

    echo '</div>';
}

Crashdownload on "php_self problem"

0
0

Hi!

I hope some one could help me this problem i got.
I hav med a plugin that sends and deletes information to and from a sql server all within the same php page. the "add" form works as it should and there is no problem there, in that form I am leaving the action="" empty to send it to the same page.

but in my "delete" form i need to add the " ?id='.$row[id].' " to get wich ID to delete but if i just add that to the action="" field it directs to wp-admin/options-general.php?id='.$row[id].' wich is incorrect as it is not directing to the plugin page like the "add" form does.

how can i get it to add the line of code to the correct " php_self " site wich is /options-general.php?page=plugin_name.php ?

romualdv on "Customer Registry (portfolio type) Page"

0
0

I'm busy working on a wedding registry website. What I want to achieve is to create a custom page with the following details of our wedding couples that register on our website (customers) that will be viewable by the guests that looked for their 'registry':

- Avatar/profile picture (with a cover pic as banner background - almost like facebook)
- a small banner with 'Registry of 'nickname_meta'
- a text area where the wedding couple can leave a message for their guests.

I would like to add the script as a shortcode to my website - if not possible that's fine as well.

Could someone please assist with this? My coding is not of such that I can do this without some help. Maybe is someone knows of a developer how can assist me that would be appreciated as well.

Many thanks!


limbworks on "Trouble with custom styled MailChimp embed form"

0
0

Hello there,

I have a MailChimp form issue and would appreciate any help from the WP community.

I am using an embedded MailChimp form I copied from my MC control panel. The form works fine until I add customized <div> tags to the code, then it stops functioning properly. The form data is submitted when the user clicks "Submit", however, the form does not send the user to the proper page with the double opt-in message. The form simply stays static, appearing as if it has not functioned.

Here is the code I'm using (also available at http://pastebin.com/puBLwZgw). All I've added is some <div> tags & changed the submit button to an image. Otherwise, I have touched nor deleted any code that should affect functionality.

<div id="customform">
<img src="http://inkwellcoach.com/wp-content/uploads/2014/01/customhead.gif" id="customhead"><div id="formwrap">
<div id="mc_embed_signup">
<form action="http://lizfemiwilson.us2.list-manage1.com/subscribe/post?u=de4a1b638169ebf9f93151e82&id=4084866ba0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

<span class="mc-field-group">
        <label for="mce-NAME">Name: </label>
        <input type="text" value="" name="NAME" class="required" id="mce-NAME">
</span>
<span class="mc-field-group">
        <label for="mce-EMAIL">Email: </label>
        <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
</span>
        <div id="mce-responses" class="clear">
                <div class="response" id="mce-error-response" style="display:none"></div>
                <div class="response" id="mce-success-response" style="display:none"></div>
        </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;"><input type="text" name="b_de4a1b638169ebf9f93151e82_4084866ba0" value=""></div>
        <div class="centerityo"><input type="image" src="http://inkwellcoach.com/wp-content/uploads/2014/01/customsubmit.png" value="Subscribe" name="subscribe" id="mc-embedded-subscribe"></div>
</form>
</div>
<script type="text/javascript">
var fnames = new Array();var ftypes = new Array();fnames[1]='NAME';ftypes[1]='text';fnames[0]='EMAIL';ftypes[0]='email';
try {
    var jqueryLoaded=jQuery;
    jqueryLoaded=true;
} catch(err) {
    var jqueryLoaded=false;
}
var head= document.getElementsByTagName('head')[0];
if (!jqueryLoaded) {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = '//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
    head.appendChild(script);
    if (script.readyState && script.onload!==null){
        script.onreadystatechange= function () {
              if (this.readyState == 'complete') mce_preload_check();
        }
    }
}

var err_style = '';
try{
    err_style = mc_custom_error_style;
} catch(e){
    err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
}
var head= document.getElementsByTagName('head')[0];
var style= document.createElement('style');
style.type= 'text/css';
if (style.styleSheet) {
  style.styleSheet.cssText = err_style;
} else {
  style.appendChild(document.createTextNode(err_style));
}
head.appendChild(style);
setTimeout('mce_preload_check();', 250);

var mce_preload_checks = 0;
function mce_preload_check(){
    if (mce_preload_checks>40) return;
    mce_preload_checks++;
    try {
        var jqueryLoaded=jQuery;
    } catch(err) {
        setTimeout('mce_preload_check();', 250);
        return;
    }
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
    head.appendChild(script);
    try {
        var validatorLoaded=jQuery("#fake-form").validate({});
    } catch(err) {
        setTimeout('mce_preload_check();', 250);
        return;
    }
    mce_init_form();
}
function mce_init_form(){
    jQuery(document).ready( function($) {
      var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };
      var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
      $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
      options = { url: 'http://lizfemiwilson.us2.list-manage.com/subscribe/post-json?u=de4a1b638169ebf9f93151e82&id=4084866ba0&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
                    beforeSubmit: function(){
                        $('#mce_tmp_error_msg').remove();
                        $('.datefield','#mc_embed_signup').each(
                            function(){
                                var txt = 'filled';
                                var fields = new Array();
                                var i = 0;
                                $(':text', this).each(
                                    function(){
                                        fields[i] = this;
                                        i++;
                                    });
                                $(':hidden', this).each(
                                    function(){
                                        var bday = false;
                                        if (fields.length == 2){
                                            bday = true;
                                            fields[2] = {'value':1970};//trick birthdays into having years
                                        }
                                        if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
                                                this.value = '';
                                                                            } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
                                                this.value = '';
                                                                            } else {
                                                                                if (/\[day\]/.test(fields[0].name)){
                                                this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;
                                                                                } else {
                                                this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
                                                }
                                            }
                                    });
                            });
                        $('.phonefield-us','#mc_embed_signup').each(
                            function(){
                                var fields = new Array();
                                var i = 0;
                                $(':text', this).each(
                                    function(){
                                        fields[i] = this;
                                        i++;
                                    });
                                $(':hidden', this).each(
                                    function(){
                                        if ( fields[0].value.length != 3 || fields[1].value.length!=3 || fields[2].value.length!=4 ){
                                                this.value = '';
                                                                            } else {
                                                                                this.value = 'filled';
                                            }
                                    });
                            });
                        return mce_validator.form();
                    },
                    success: mce_success_cb
                };
      $('#mc-embedded-subscribe-form').ajaxForm(options);

    });
}
function mce_success_cb(resp){
    $('#mce-success-response').hide();
    $('#mce-error-response').hide();
    if (resp.result=="success"){
        $('#mce-'+resp.result+'-response').show();
        $('#mce-'+resp.result+'-response').html(resp.msg);
        $('#mc-embedded-subscribe-form').each(function(){
            this.reset();
        });
    } else {
        var index = -1;
        var msg;
        try {
            var parts = resp.msg.split(' - ',2);
            if (parts[1]==undefined){
                msg = resp.msg;
            } else {
                i = parseInt(parts[0]);
                if (i.toString() == parts[0]){
                    index = parts[0];
                    msg = parts[1];
                } else {
                    index = -1;
                    msg = resp.msg;
                }
            }
        } catch(e){
            index = -1;
            msg = resp.msg;
        }
        try{
            if (index== -1){
                $('#mce-'+resp.result+'-response').show();
                $('#mce-'+resp.result+'-response').html(msg);
            } else {
                err_id = 'mce_tmp_error_msg';
                html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';

                var input_id = '#mc_embed_signup';
                var f = $(input_id);
                if (ftypes[index]=='address'){
                    input_id = '#mce-'+fnames[index]+'-addr1';
                    f = $(input_id).parent().parent().get(0);
                } else if (ftypes[index]=='date'){
                    input_id = '#mce-'+fnames[index]+'-month';
                    f = $(input_id).parent().parent().get(0);
                } else {
                    input_id = '#mce-'+fnames[index];
                    f = $().parent(input_id).get(0);
                }
                if (f){
                    $(f).append(html);
                    $(input_id).focus();
                } else {
                    $('#mce-'+resp.result+'-response').show();
                    $('#mce-'+resp.result+'-response').html(msg);
                }
            }
        } catch(e){
            $('#mce-'+resp.result+'-response').show();
            $('#mce-'+resp.result+'-response').html(msg);
        }
    }
}

</script>
<!--End mc_embed_signup-->
</div>
<img src="http://inkwellcoach.com/wp-content/uploads/2014/01/customfooter.gif" id="customhead">
</div>

Thanks again for your time. I've contacted MailChimp support and they say they do not offer support for any customization of their embedded form. I'm hoping someone here can help.

genzki on "Long Permalink on Backend"

MirrorDesigns on "Auto Populate a set of pages"

0
0

I am very very very new to wordpress and PHP, I am currently setting up a page that I only activate new members on. What I am wondering is, if there is a way to set up my site so that when I add a member it will automatically automatically setup a page called "Bio - member name" and a photo gallery? I am using the plugin NextGen Gallery for my galleries. other than that I have no clue :/ I haven't come across a plugin for this as of yet but maybe you more experienced people will no the answer. I have the site live on a dummy domain if you want to see what I have so far. http://www.mirrordesigns.net

gerard749 on "`onclick=”window.print();`"

0
0

Hi,
I am using
<a title="Print Screen" alt="Print Screen" onclick="window.print();" target="_blank" style="cursor:pointer;">PRINT BUTTON</a>
on my website. (a WordPress responsive theme) Will this code also work on mobile devices.
Thank You
Jerry

ryansigg on "Quick method for adding Child page from Parent"

0
0

In the never-ending hunt to make WP even easier and quicker for clients, I'm looking for a method to add Child posts/pages/CPTs from a parent page (I've searched the forum, but it seems almost every "child page" topic deals with adding child pages to the menu).

I don't even know if such a thing is really possible from one page to another... I have not seen anything like this, aside from plugins which automatically add multiple pages at once (like "Simple add pages or posts")

It doesn't need to be an in-page, AJAXy sort of thing; just a URL to a new page with the Parent already set would be great.
Perhaps there is a way to add a parameter to the "Add New" URL (wp-admin/post-new.php?post_type=custom_type_here) to specify a parent URL?
Or perhaps there is a plugin that I have not found in all my searching?

Thanks!

Viewing all 8245 articles
Browse latest View live




Latest Images