Forum Replies Created

Viewing 15 replies - 136 through 150 (of 158 total)
  • Thread Starter candell

    (@candell)

    Actually thinking about it, only the homepage needs this functionality, the rest of the site can use standard menus.

    How would I implement this in wordpress for only the homepage? I could use custom fields, not very user friendly but it would work on the homepage template only.

    Any other suggestions?

    I can’t see the post in question either.

    Just a side note, there are a heck of a lot of images on your homepage as all of the content loads, you might want to put a lazy load or something on your website to prevent any bandwidth issues with your host.

    You need to do a find and replace on your old url, replacing with your new url.

    for example find all instances of

    http://www.yourwebsite.com/subdirectory/

    with

    http://www.yourwebsite.com

    otherwise all the links in the admin and public facing versions of your site will point to the subdirectory version of your website.

    Personally I find it easier to find/replace on the backup.sql filerather than in the database as you have to write find and replace sql commands.

    Try removing the last comma on chandanonline4u’s first array, so

    $cardef = array(
    'pageid' => 0,
    'style' => 'style22',
    'category' => $obj,
    'blocktype' => 'cattiles',
    'appearence' => 'catpages',
    'blockheadline' => $carouseltag,
    );

    becomes

    $cardef = array(
    'pageid' => 0,
    'style' => 'style22',
    'category' => $obj,
    'blocktype' => 'cattiles',
    'appearence' => 'catpages',
    'blockheadline' => $carouseltag
    );

    Pants, I was going straight to the checkout. Thanks Chumbo

    Maybe a stupid question, but where does the buyer enter a promotion code? I created one to apply to all products to save £5. I expected a field in the checkout for the buyer to enter the promotional code, but nothing is showing. Is there some other flag I need to turn on to activate promotions?

    Thanks

    Thread Starter candell

    (@candell)

    Still struggling to find a solution to this if anyone can help?

    Thread Starter candell

    (@candell)

    Hi Christian

    You can build your queries with an array, this gives you so much power to gather exactly what you need from wordpress

    $myquery = array();
    $myquery['post_type'] = 'page';
    $myquery['post_status'] = 'publish';
    $myquery['meta_key'] = '_wp_page_template';
    $myquery['meta_value'] = 'scheme.php';
    $myquery['posts_per_page'] = '10';

    I have used this on other pages since, worked perfectly every time.

    Thread Starter candell

    (@candell)

    In the meantime I have created two different menus and written a script that calls the new menu using wp_nav_menu if on the filter page, else display the normal menu.

    Our menu has lots of links though so will be a nightmare to maintain. If anyone has a programatical way of doing it I would love to know.

    Thanks

    Thread Starter candell

    (@candell)

    I used query_posts() to achieve what I was after, you can pass all sorts of arguments to it making it very powerful to generate very custom queries

    Thread Starter candell

    (@candell)

    Aha didn`t know about that, thank you very much for the help.
    My first wordpress (and php) website, usually work in asp so it is a learning curve at the moment.

    Thread Starter candell

    (@candell)

    Getting there, but I have two problems

    1. category1 has just one line of text in the description, so I want to remove the paragraph tags. My replace doesn`t remove them

    2. my print isn`t working as I’d hoped;
    I need to output
    <h2 class="cat2"><a href=thelink>The title</a></h2>
    so I used
    echo '<h2 class="cat2"><a href="'.the_permalink().'">'.the_title().'</a></h2>';
    but I get
    thelink thetitle<h2 class="cat2"><a href=""></a></h2>

    Why is it doing that?

    Thanks

    http://pastebin.com/LpN7yeYx

    Thread Starter candell

    (@candell)

    Trying a different tact, instead of going directly into the database poking around the wordpress knowledgebase I found some fucstions that should do what I am after.

    I am almost there but for two things

    1. It is printing the correct number of results but all of the titles are the title of the page I am currently on when testing the code. How do I make it pull the title from the row in the loop?

    2. It is bringing in everything due to the first line requesting everything of status ‘publish’. I also need to limit the output based upon the meta_key of ‘ _wp_page_template’ being set to ‘scheme.php’

    <?php $pages = get_pages(array('post_status' => 'publish')); ?>
    
    <?php foreach($pages as $page) { ?>
    
    <h1><?php the_post_thumbnail(); ?><?php the_title(); ?></h1>
    
    <p><?php echo get_post_meta($page->ID, 'schemeprice', true) ?></p>
    
     <?php }?>
    Thread Starter candell

    (@candell)

    Still plugging away at this. I need two column values from posts and two rows from metadata so I decided the way to go is to run a query on posts that will grab what I need from there, then within the output loop to run two queries from metadata based on the post_id and also the meta_key.

    My second query isnt working though, it isnt being built correctly

    [Code moderated as per the Forum Rules. Please use the pastebin]

    echo $querystr2; is coming out as

    SELECT FROM wp_postmeta WHERE = ‘231’ AND = ‘_wp_attached_file’ so it is missing what to select and the condition in the AND.

    Thread Starter candell

    (@candell)

    Oh I see what is wrong with the last posts sql, I am calling wp_postmeta.meta_value twice.

    How do I call it so that it matches both i.e.

    for post_id = 10

    wp_postmeta._wp_page_template = ‘scheme.php’

    AND

    wp_postmeta._wp_attached_file = not empty

Viewing 15 replies - 136 through 150 (of 158 total)