Forum Replies Created

Viewing 15 replies - 31 through 45 (of 59 total)
  • Thread Starter mYrAn

    (@myran)

    Oh, thank you!
    The theme is built up like this:
    A post acts like a page for a show, containing info, pictures, youtube videos and an image slider. Everything on it besides the content and title is essentially controlled by custom fields. So on every page there is a slider, this infofield that i need to get in order, optional youtube video and optional pdf button, all which are controlled by custom fields. The easiest way would be to exclude the otherones, since those are “static” while the menu can be dynamic, it doesnt allways include the same stuff. So what i want is to order Every custom field except; cycle, pdf, youtube, underrubrik, in the way i put typed them in in the admin panel. So if i were to type in key Friday value Bananas and then key Saturday value Apples i want Friday to be the first to be outputted, saturday secound, sunday monday etc etc. And i want it to do this to all but the fields i mentioned above, it doesnt matter which order they come in 🙂 Ill provide more info if you need it, this is what i could make out right now!

    Thread Starter mYrAn

    (@myran)

    Well, i got absolutely nowhere. I dont even know if it got the right values since i couldnt echo, it just sayed array and i didnt know which variable to try and echo 🙁 Secoundly I have absolutely no idea how to order them, if i somehow got the meta_id part right, i tried using ORDER BY that i found in one of the examples but i really couldnt make any sense of how it worked..

    <?php
    $mydata = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = the_ID() ORDER BY ASC");
    // Where X should be the applicable post ID
    if ( $keys = get_post_custom_keys($mydata) ) {
    foreach ( (array) $keys as $key ) {
    $keyt = trim($key);
    if ( '_' == $keyt{0} || 'cycle' == $keyt )
    continue;
    $values = array_map('trim', get_post_custom_values($key));
    $value = implode($values,', ');
    echo apply_filters('the_meta_key', "
    <div class='row'><div class='left'>$key</div><div class='right'>$value</div><!-- /right --></div><!-- /row -->
    ", $key, $value);
    }} ?>
    <?php echo $mydata['meta_id']; ?>

    Thread Starter mYrAn

    (@myran)

    If you boule help me compile the function i would be really grateful! I know almost no php 🙁

    Thread Starter mYrAn

    (@myran)

    So there is no way to fetch that data? I dont care how i get them in the order i put them in, aslong as a client can do it, so Not to hard.

    You could make an if, something like this

    <?php if( is_page(19) ) {
    echo get_template_part( 'header', 'custom' );}
    else {
    echo get_header(); } ?>

    That way, if the page id is 19 it’ll post the templatefile header-custom.php instead of the usual header. You could substitute is_page()
    with e.g.

    is_page(array(1, 2, 3, 4, ))
    is_home()
    in_category(3)

    And it loads what ever you write, like ding-dong.php would be echo get_template_part( ‘ding’, ‘dong’ );}.
    You can also make elseif’s to have different conditions, if you have multiple headers.

    Havnt tested it out so i dont know if it’s working, but it should.

    Though, if u only make small changes and know which pages the change should be active, you’re easier of by just doing this:
    <?php if( is_page(2) ) { echo "settings for page 2"; } else { echo "settings for all other pages"; } ?>

    Forum: Plugins
    In reply to: order by ‘meta_id’

    Im looking for this too, would be really good if someone could respond..

    Thread Starter mYrAn

    (@myran)

    I found this

    http://wordpress.org/support/topic/need-a-plugin-or-a-way-to-exclude-a-particular-key-value-from-the_meta?replies=5

    But now i have another problem. It doesnt output them in the right order, or there is no order at all. How do i make it put them in the order i put them in?

    If you download the wamp installer it should set everything up for you, then you just put the wordpress folder in your documentroot and go to it with like http://localhost/wordpress . Make sure you put the server online.

    That’s because your post container has a fixed width, so even if you remove the sidebar it still has the same width. You’re going to want it to be automatic, so it fills the space even when the sidebar isn’t there.

    Forum: Fixing WordPress
    In reply to: How do I…

    You’re refering to an id by putting # before the linkreference, but the things you want to take them to dont have an id. Put id=”membership” on the h2 and remove the anchor. Like this:

    <h2 class="titles" id="membership">
    Membership
    </h2>

    Hope thats what your looking for!

    Which admin-panel are you talking about? if it’s the wp panel you have to install it first, then go to http://localhost/path/to/wpfolder/wp-admin

    If you want to have it on certain pages generated by lets say page.php but not all of them, you can make an if. Like this:
    <?php if( is_page(array(7, 13, 15, 17, 19)) ):?>
    <div class=”blabla”><?php get_sidebar(); ?></div>
    <?php else: endif; ?>

    Or something like that! This requires that you know the ids of the pages you want to include Or exclude though.

    Forum: Plugins
    In reply to: Simple $page_id if help
    Thread Starter mYrAn

    (@myran)

    I figured it out myself!

    <?php if( is_page(array(81, 52)) ):?>
    code here
    <?php else: ?>
    else code here
    <?php endif; ?>

    Hope thats a legit way of doing it!

    Thread Starter mYrAn

    (@myran)

    Bump 2..

Viewing 15 replies - 31 through 45 (of 59 total)