Forum Replies Created
-
AuthorPosts
-
thoughtonParticipant
Fantasitc! I copied lines 496-609 into my functions.php and everything works! New posts default to right sidebar, and new projects default to full width.
(At first I used all 3 of your files, but that resulted in posts having the sidebar below the comments form.)
All perfect now, cheers!
thoughtonParticipantSorry the above post is so long. Basically what I want to do is:
if page is ‘add new project’ then
‘options’ => array(‘Full Width’,’Right Sidebar’,’Left Sidebar’
else
‘options’ => array(‘Right Sidebar’,’Full Width’,’Left Sidebar’What if/else can I use to do that?
Thanks
thoughtonParticipantOkay I’ve fiddled around and got nowhere fast :)
I’m trying something like this:
if( get_post_type($post->ID) == 'project' ) {
$kanso_sd_meta_box = array(
'id' => 'post-layout-choice',
'title' => 'Post Layout',
'page' => 'post',
'context' => 'side',
'priority' => 'core',
'fields' => array(
array(
'name' => 'Pick one:',
'id' => $kanso_sd_prefix . 'post-layout',
'type' => 'select',
'options' => array('Full Width','Right Sidebar','Left Sidebar')
)
)
);
} else {
$kanso_sd_meta_box = array(
'id' => 'post-layout-choice',
'title' => 'Post Layout',
'page' => 'post',
'context' => 'side',
'priority' => 'core',
'fields' => array(
array(
'name' => 'Pick one:',
'id' => $kanso_sd_prefix . 'post-layout',
'type' => 'select',
'options' => array('Right Sidebar','Full Width','Left Sidebar')
)
)
);
}Obviously I’m doing something wrong :) Is there an if I can use to make the ‘options’ conditional? Thanks!
thoughtonParticipantThanks Andrii,
I’ve already tried fixing my problem using Simple WP Retina yesterday but it didn’t work.
I also yesterday restored my local uploads folder via Time Machine, and re-uploaded the (non optimsed) images. Retina.js still goes crazy and removes everything!
Anyway, I’ve run out of time and budget on this one. I will just comment out the retina.js call on line 19 of functions.php and leave the site as is. Most of the important bits are retina anyway, the logo, and the photo gallery featured images.
Thanks for all your assistance!
Tim
thoughtonParticipantHi Andrii,
Thanks again for being so helpful!!!
I tried out the new files, but I noticed it removes the ‘page layout’ box entirely. This also affects the ‘new post’ and ‘new pages’ pages, not only the ‘new project’.
In the end I think I’ve managed to do what I want anyway. I just re-ordered the options on line 510 of functions.php. From this:
'options' => array('Right Sidebar','Full Width','Left Sidebar')
to this'options' => array('Full Width','Right Sidebar','Left Sidebar')
This (so far!! haha) seems to work. I’m now looking into making it conditional so this only happens on the projects pages.
Thanks again!!
thoughtonParticipantI was downloading images from the uploads folder, then using ImageOptim on my Mac, and reuploading them. I’ve done this before on other WP sites and everything seemed okay.
Ideally I would like retina.js to work, but something has gone wrong with it. It is removing every image on the site, including all of the ones that don’t have a @2x version. Shouldn’t it ignore the ones that don’t have @2x versions? I’m pretty sure it used to work properly, but in the last week or so something has gone wrong and I can’t think what.
thoughtonParticipantIn case it helps you with debugging I’ve discovered I can prevent the images vanishing if I delete retina.js
thoughtonParticipantPS If it makes it any simpler I don’t need right or left sidebars at all on my projects page, it will be full-width all the time. If it’s easier completely removing the ‘Post Layout’ box would be fine with me.
I do use right-sidebar on my news pages though.
Thanks!
- This reply was modified 10 years, 3 months ago by thoughton.
thoughtonParticipantHi Andrii,
I’ve uploaded the 2 new files (header and single-project) but unfortunately they don’t seem to do anything. When I add a new project the Post Layout drop down still defaults to ‘Right Sidebar’, and if I go ahead and publish there is a sidebar on the right.
Tim
thoughtonParticipantThanks Andrii!
-
AuthorPosts