Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • I downloaded the plugin and tried inserting the shortcode into one of my posts and got nothing but the loading animated gif. Ended up being I had forgotten to call the wp_footer(); function in the footer of my custom theme that I was creating. Many plugins need this function to be called to hook into for functionality. So make sure this is being called in your theme.

    This answer is in regards to having issues with hiding and showing required fields. For example if you are trying to hide a text box that is required as part of the form, and only show it when a certain value is selected from a dropdown, you are going to have trouble with submitting the form when the text box is still hidden since the user cannot enter in a value.

    The solution I came up with was to use Jquery to alter the value attribute of the text box. It’s an ugly hack, but was the most simple solution I could come up with in short time.

    My JQuery code:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <script type="text/javascript">
    			$(document).ready(function(){
    				$('.hide').hide();
    				$('.hide input').val('n/a'); //give the text box a value when it is hidden so it passes the required field validation.
    					//Show the text field only when the third option is chosen - this doesn't
    					$('.dropdown').change(function() {
    						if ($(this).val() == "Other") {
    							$(this).parent().parent().next('p').find('input').val(''); //give an empty string as its value before sliding it down so it will not pass the required field validation.
    							$(this).parent().parent().next('p').slideDown('fast');
    					}
    						else {
    							$(this).parent().parent().next('p').slideUp('fast');
    							$(this).parent().parent().next('p').find('input').val('n/a'); //give back its value so it passes validation
    					}
    					});
    			});
    		</script>

    As for the conditional fields in the email text itself, I have not looked into this thus far. If I end up doing so and find a solution I will make a post about it.

    I ran into the same issue…there should really be more options for what you want your blank value to be…but I suppose they are trying to keep this plugin as simple to use as possible.

    Solution: I went into your plugins directory wp-content/plugins/contact-form-7/modules/select.php

    This file I edited at line 65 which reads: array_unshift( $labels, ‘—‘ );
    Change this line to read: array_unshift( $labels, ‘Whatever Label You Want’ );

    BOOM: New include_blank text to whatever you want.

    Thread Starter bmoore2

    (@bmoore2)

    I apologize I put the wrong code in there this is for my single.php
    Here is what you want:

    <?php
    /*
    Template Name: blog_posts
    */
    
    ?>
     <?php
        // Get News
        $news_args = array(
    
            'order_by' => 'post_date',
            'order' => 'DESC',
    		'numberposts'=>1000
        );
    
        $articles = get_posts($news_args);
    ?>
    
    <?php include 'header.php' ?>
    <?php include 'top_logo.php' ?>
    <?php include 'top_nav.php' ?>
    
    <div style="margin-top: 20px;"></div>
    
    <table><tr>
    
        <td style="width:100%;  padding-right: 10px;" valign="top">
    
    		    <?php if ( $articles ): ?>
            <?php foreach ( $articles as $article ): ?>
            <div id="news_article_<?php echo $article->ID; ?>">
            <div><a style="color:blue;" class="title" href="<?php bloginfo( 'url' ) ?>/index.php/<?php echo $article->post_name ?>"><?php echo $article->post_title ?></a></div>
            <br />
    		<p style="font-size:12px; font-style:italic;"><?php  the_time('m/j/y g:i A') ?></p>
    		<p style="font-size:12px; font-style:italic;"><?php echo $article->ID;  ?></p>
            <div class="type_liner"><?php echo $article->post_content  ?>
            </div>
    
            <div style="margin-top: 20px;"></div>
            <?php endforeach; ?>
    
        <?php endif; ?>
    
        </td>
    
    </tr></table>
    <div style="margin-top: 20px;"></div>
    <?php include 'footer.php' ?>
    Thread Starter bmoore2

    (@bmoore2)

    Well I believe I know what the problem was. I was on the right track with checking my backups. My backups were set to sychronization for this directory, so it was copying back any files in the destination back to the source, even if I deleted it from the source.

    Thread Starter bmoore2

    (@bmoore2)

    I apologize it is actually an html file -> index.html -> I deleted and then restored it to take a look at its properties and contents.
    It says it is being created in the early morning when I certainly was not working on it then. I am going to check to see if it is something scheduled with my backups or something else related. But any other info you can give me would be helpful thank you.
    Contents:

    <html>
    <head>
    <title>Norfolk Utility Truck Service</title>
    </head>
    <body>
    <center>
    Thank you for visiting Norfolk Utility Truck Service.
    </center>
    </body>
    </html>

Viewing 6 replies - 1 through 6 (of 6 total)