From 6fe1dfe7837b297643593ee26a7d4c42f2b6b8cf Mon Sep 17 00:00:00 2001 From: matheus Date: Thu, 12 Mar 2015 16:06:28 -0300 Subject: [PATCH] issue #1 --- .gitignore | 35 +++++++++++++++++++++++++++++++++++ archive-agenda.php | 3 ++- custom-agenda.php | 4 +++- functions.php | 2 -- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..770a25c --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# Global +._* +.AppleDouble +.DS_Store +.localized +.LSOverride +.Spotlight-V100 +.Trashes +Icon +Desktop.ini +ehthumbs.db +Thumbs.db +*~ +TAGS +tags +.*.sw[a-z] +.netrwhist +*.un~ +Session.vim +*.sublime-project +*.sublime-workspace +*.sublime-projectcompletions +*.tmproj +*.tmproject +tmtags +nbproject/* + +# Project +src/.sass-cache/* +src/node_modules/* +src/.ftppass +src/tmp/* +assets/js/main.min.js +odin.zip +sftp-config.json diff --git a/archive-agenda.php b/archive-agenda.php index 401e44e..58daea4 100644 --- a/archive-agenda.php +++ b/archive-agenda.php @@ -9,8 +9,9 @@ query('post_type=agenda' . '&paged=' . $paged . '&posts_per_page=8&order=DESC'); +$wp_query->query('post_type=agenda' . '&paged=' . $paged . '&posts_per_page=8&orderby=meta_value&order=ASC&meta_key=ag_data'); while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> ID,'_my_meta',TRUE); ?> diff --git a/custom-agenda.php b/custom-agenda.php index c0d769e..d9d482a 100644 --- a/custom-agenda.php +++ b/custom-agenda.php @@ -128,7 +128,9 @@ function my_meta_save($post_id) { add_post_meta($post_id,'_my_meta',$new_data,TRUE); } - + if(!empty($_POST['_my_meta']['ag_data'])){ + update_post_meta($post_id,'ag_data',$_POST['_my_meta']['ag_data']); + } return $post_id; } diff --git a/functions.php b/functions.php index c67fd94..9bab1a6 100644 --- a/functions.php +++ b/functions.php @@ -105,6 +105,4 @@ function custom_login() { echo ''; } add_action('login_head', 'custom_login'); - - ?> \ No newline at end of file