dikkiedutton

Member

Forum Replies Created

  • In reply to: Search

    #33867

    So i’ve found a solution that searches only pages, again – isn’t ideal. But if anyone knows of getting the pages first then posts last – I’d settle for that!

    Add this to functions.php:

    <?php
    function mySearchFilter($query) {
    $post_type = 'page';
    if($query->is_main_query()){
    if ($query->is_search) {
    $query->set('post_type', $post_type);
    }
    }
    };
    add_action('pre_get_posts','mySearchFilter');
    ?>

    In reply to: Search

    #33866

    OK, so now I have it looking reasonable again… the search is working better and pulling out content on the pages – however it seems to be still putting the posts at the top of the results – when, in this instance, the page content is more important. Is there a way of prioritising the page content?

    Cheers

    Dikkie

    In reply to: Search

    #33865

    Ahh, just changed it to that and that’s taken me back a few steps… bugger! Let’s hope it does something nice behind the scenes.

    Thanks anyway – appreciate it (in some weird kind of ‘got to redo bits to the website’!)

    Cheers

    Dikkie

    In reply to: Search

    #33863

    I’ve installed the Relevanssi plugin and that seems to be working better. If anyone has any better ideas without using a plugin – gratefully received.

    In reply to: Search

    #33862

    In so much as setting a static home and posts page?

    In reply to: Search

    #33860

    And that’s the issue – it’s pulling results from the posts. I want the search results to pull everything the search string results from the posts AND the pages. For instance, if you search for ‘health’ i know that’s on a few of the PAGES in the content. However, it’s pulling out the four posts on the site plus one page. I’m using this as a website as opposed to a blog so the page content is perhaps more important than the posts.

    In reply to: Excerpts on news/posts page

    #33857

    Got it sorted with a plugin called Archive. Seems to do what I’m asking.

    In reply to: Excerpts on news/posts page

    #33856

    So if I wanted to create a page as a child page to ‘News’ that was specifically for holding an archive, how would I go about that?

    Cheers

    In reply to: Excerpts on news/posts page

    #33854

    Thanks Prasanna, however this has led me to another question… archives…?

    How do I set that up? Do I have to create another page?

    Cheers

    Dikkie

    In reply to: Image map on rotating header images

    #33660

    For those of you who are (not) interested. Here’s how I’ve done it:

    Add this to the CSS:

    dl.image_map {
    display: block;
    width: 960px;
    height: 198px;
    position: relative;
    padding: 0px;
    }
    a.LINK0 {
    left: 549px;
    top: 135px;
    background: transparent;
    }
    a.LINK0 {
    display: block;
    width: 250px;
    height: 0;
    padding-top: 13px;
    overflow: hidden;
    position: absolute;
    }
    a.LINK0:hover {
    background: transparent;
    border: 1px dashed black;
    color: black;
    }

    Then add this to a ‘graphene_header’ action hook in widgets:

    <dl class="image_map">
    <dd><a class="LINK0" title="Email" href="mailto:email@email.com"></a></dd>
    </dl>

    Again, probably a better way to do it but this works for now!

    Cheers

    Dikkie

Viewing 10 posts - 1 through 10 (of 17 total)

  • 1
  • 2