mYrAn
Forum Replies Created
-
Forum: Hacks
In reply to: Sort custom fields after meta_id, not randomlyOh, 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!Forum: Hacks
In reply to: Sort custom fields after meta_id, not randomlyWell, 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']; ?>Forum: Hacks
In reply to: Sort custom fields after meta_id, not randomlyIf you boule help me compile the function i would be really grateful! I know almost no php 🙁
Forum: Hacks
In reply to: Sort custom fields after meta_id, not randomlySo 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.
Forum: Hacks
In reply to: Load different header.php files on different pages?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..
Forum: Hacks
In reply to: Custom post, exclude and includeI found this
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?
Forum: Fixing WordPress
In reply to: login on a wamp serverIf 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.
Forum: Fixing WordPress
In reply to: how to remove sidebar from selected pagesThat’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…http://wordpress.org/extend/plugins/feedburner-subscription-widget/
This seems to do the trick.
Forum: Fixing WordPress
In reply to: Anchors not workingYou’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!
Forum: Fixing WordPress
In reply to: login on a wamp serverWhich 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
Forum: Fixing WordPress
In reply to: how to remove sidebar from selected pagesIf 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 helpI 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!
Forum: Plugins
In reply to: Help me unravel media.php imagegallery..Bump 2..