Forum Replies Created

Viewing 15 replies - 1 through 15 (of 65 total)
  • Thread Starter calicosun

    (@calicosun)

    Thank you so much for taking the time to reply. I have tried a few different calls to get the specific category and works fine usually but the slider doesn’t work.

    I actually think the problem is more to do with the fact that the slider works fine if called on the index page ie. https://www.sitename.com/#, even when specifying the category I would like but I can’t seem to get it to work if I use a static page, apply a template and put the code from the index page into the template to all the posts. The biggest problem is ‘me’ as I don’t have any knowledge of JQuery scripts so don’t know where to start looking. Have spent the past few days searching to find a solution but as above, don’t really know where to start.

    Hi anandpadia. Did you manage to get this to work? I have a similar problem – using viewpoint theme and unable to get the slider to work on a static page with a template applied ie.

    1. Created a template called work.php (template name: work)
    2. Copied code from index file (similar to what is above) into work.php file
    3. Created a page called ‘work’ and applied the work template to it.
    4. Created a category called work and added <?php query_posts( 'cat=3' ); ?> to the loop to call just the work categories.
    5. Created several posts and applied the work category
    6. Set up ‘work’ link in menu (using appearance/menu).
    7. Clicked on ‘work’ link and the first post with work category applied displays but when you click on the left/right arrow the slider doesn’t work.

    It works fine using the <?php query_posts( 'cat=3' ); ?> on the index page and going to https://www.sitename.com/# but not when called post into a static page.

    I know nothing about JQuery scripts so have no idea where to even start in solving this.

    pils.schouler – I tried copying and pasting your revised code (couldn’t figure out what changes you made) but that didn’t work either… but thanks for the help anyway.

    Any more ideas anyone?

    Thread Starter calicosun

    (@calicosun)

    Hello

    Sorry, I should have written my question more clearly I didn’t mean that I thought the plugin was responsible for the problems. I wasn’t sure where the problem was originating from and was just asking the question to make sure there was nothing I was missing with regard to setup etc with the Contact Form 7 – Campaign Monitor Addon plugin.

    It was as a result of not having Akismet installed. I didn’t realise (yes I know, dumb) that the subscription form was so susceptible to spam. I have another site (Drupal) which has absolutely no problems at all with the subscription form. We didn’t install Akismet because the monthly cost is almost half the hosting cost and for a small business website it makes my services not competitive compared to other web options in our area – I either have to drop my hosting fee and basically pay for Askismet myself or miss out on the work.

    Thread Starter calicosun

    (@calicosun)

    Hello gordonek

    I ‘think’ I have figured out how to fix my problem so will explain what I did in the hope it can help you.

    First of all, the issue was related to the email subscription form which was created using the Campaign Monitor addon. There is no captcha on the form which means that spam bots can invade.

    The emails were blank because I had no information entered in the Mail fields (except the clients email). As soon as I entered information such as [your-name] <[your-email]> in the from field and something in the Subject field the spammy emails had a from name… still no subject.

    I then set up Askismet which I think is what has actually solved the problem.

    In your case, if you are experiencing problems with the contact form only it might be because you don’t have the captcha enabled.

    Also, check to see what information you have entered in the Mail fields (group of fields below the form fields). If you don’t have [your-name] <[your-email]> in the From field any enquiries you get will say they are from wordpress.

    Am still not 100% that the problem has been fixed – still monitoring the situation.

    Thread Starter calicosun

    (@calicosun)

    Thanks esmi. I have had a look around in there but can’t find anything to help me with securing the Campaign Monitor Addon plugin. That is where the spam is coming from.

    Thread Starter calicosun

    (@calicosun)

    I forgot to mention, I am also using the Campaign Monitor addon. I wasn’t sure what to put in the Mail from field here so left it blank. Should I be putting:
    [your-name] <[your-email]>
    in that field as well perhaps?

    Thread Starter calicosun

    (@calicosun)

    Hello

    No sorry, I gave up trying to figure it out as ran out of time.

    Thread Starter calicosun

    (@calicosun)

    Sorry for wasting your time. After spending another day trying to figure this out, including asking my host several times ‘have I set it up right from your end’ and been told I had… it turns out I hadn’t done it quite right.

    Because the two websites were on different servers I had to do an extra step.

    Thanks so much.

    Thread Starter calicosun

    (@calicosun)

    I thought that too but the weird thing is that the emails work absolutely fine when I tested them on another website that used Contact Form 7 and they work fine in general.

    The link is contact form 7 and the 301 redirect but I don’t see why a 301 redirect should affect the email address. It is actually on a different server from the new website too.

    I really need to talk with the developer of Contact Form 7 to find out if there is any code that might conflict with a 301 redirect. Without knowing this I am in the dark and so are my hosting providers.

    I was hoping they might check this area and shine some light on things.

    Thread Starter calicosun

    (@calicosun)

    Sorry, didn’t refresh my screen before sending the above… yes, it is still all set up and the emails work fine for everything else, including as per above when I put them in other client contact forms as a test.

    I have been back and forth with my host to see if they have any ideas but they don’t know either. As far as they can see I have everything set up perfectly.

    Hey, and thanks so much for responding so quickly.

    Thread Starter calicosun

    (@calicosun)

    I also forget to mention that their email addresses work perfectly with Contact Form 7 on other websites.

    Thread Starter calicosun

    (@calicosun)

    Hi

    I just tried a different way of doing it as follows:

    <?php
    //get 5 recent posts for categories 14 and 9
        $args=array(
          'post_type' =>'testimonials',
          'showposts'=>1,
          'orderby'=>'rand',
          'caller_get_posts'=>1
        );
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          /* echo '5 recent Posts'; */
          while ($my_query->have_posts()) : $my_query->the_post(); ?>
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
            <?php the_excerpt('<div class="readmore">'); ?><a href="/testimonials">read more...</a>
           <?php
          endwhile;
        } //if ($my_query)
      wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

    Is this the more appropriate way to approach something like this?

    Just out of interest, what is the correct technical way to refer to each approach ie. are they both queries or is one referred to as an ‘array query’ and if so what is the other type of code called?

    Thanks.

    Thread Starter calicosun

    (@calicosun)

    I did the following in the sidebar code for testimonials:

    <?php
                        $posts = get_posts('post_type=testimonials&post_status=publish&numberposts=2&orderby=rand');
                        foreach ($posts as $post) : setup_postdata($post); ?>
                           <h3><?php the_title(); ?></h3>
                        <?php the_excerpt('<div class="readmore">'); ?><a href="/testimonials">read more...</a> 
    
                <?php endforeach; ?>
                    <?php endif;
    
                //Reset Query
                wp_reset_query();?>

    but the page broke – what did I do wrong? ??

    Thread Starter calicosun

    (@calicosun)

    Hello

    Will test it now. Just to clarify. I should put the following after the code in the side bar AND the loop on each page:

    <?php endforeach; ?>
    <?php endif; ?>
    <?php wp_reset_query(); ?>

    Or just on the pages, not the sidebar code?

    Is there a more appropriate variable that I should be using or is $post the only option?

    Thank you so so much for your help.

    Thread Starter calicosun

    (@calicosun)

    I have just tested the recent posts code on another test site (has the same problems as the testimonials but is easier to set up quickly on another site) and the same problem occurs where the first recent post title is displayed on pages instead of the page content.

    Here is the url: https://stitchworks.slicetest.co.nz/about/

    If you go down to the bottom of the left sidebar I have plonked the following code:

    h2>Test</h2>
    
    <ul>
    
                <?php $posts = get_posts("category=7" . $cat->cat_ID . "&numberposts=4");
                if( $posts ) : ?>
                <?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
                <li><a href="<?php // bump out what we need courtesy of template tags
                the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
    
                <?php endforeach; ?>
                    <?php endif; ?>
                </ul>

    On the about and contact pages the News 04 title is displayed instead of the correct content.

    – Doesn’t happen on the homepage as the content there is called from template files.
    – Doesn’t happen on the news page as that is the page that displays the news.
    – Doesn’t happen in the gallery. Not sure why. The gallery is a separate template page called gallery.php.

    It seems to have something to do with the loop as the home page on the tbm site is a template page as well and still has the problem.

    Am I not closing the sidebar code properly. I get a bit confused with what should go at the end of this type of code ie.

    <?php endforeach; ?>
    <?php endif; ?>

    or reset query?

Viewing 15 replies - 1 through 15 (of 65 total)