billybob71a
Forum Replies Created
-
I had to downgrade my MySQL server to 5.7 to resolve this issue. I am on Ubuntu 18.04.
I had to downgrade my MySQL server to 5.7 to resolve this issue. I am on Ubuntu 8.04.
Forum: Themes and Templates
In reply to: [Hitchcock] adding a sidebar widgetI did not manage to get the sidebar widget working as I wanted it. It still displays within the class “post-container”. For the language switcher go to “Appearance” > “Menus”, select the menu that you want edit and put a check on “Language Switcher” and then “Add to Menu”.
Peter
Forum: Themes and Templates
In reply to: [Hitchcock] adding a sidebar widgetHi Anders,
Yes, it does.
Site is “https://www.visorsourcing.com”
I think I am pretty close to adding the widget to where I want it.
I added the following to functions.php. The “login/logout register” link appears in the “.content” area, but I want it to appear just below the Navigation bar. Do you know if that is possible?//Petery code, the following will add a widgetized sidebar , maybe
function wpsites_before_post_widget( $content ) {
if ( is_singular( array( ‘post’, ‘page’ ) ) && is_active_sidebar( ‘sidebar-1’ ) && is_main_query() ) { ?><div id=”myprefix-widget-area-wrap”><?php
dynamic_sidebar(‘sidebar-1’); ?>
</div>
<?php
}
return $content;
}
add_filter( ‘the_content’, ‘wpsites_before_post_widget’ );
?>Forum: Themes and Templates
In reply to: [Hitchcock] adding a sidebar widgetOk, in my functions.php, I have:
add_action( ‘widgets_init’, ‘petery_sidebar’ );
function petery_sidebar() {
register_sidebar( array(
‘name’ => __( ‘Sidebar name’, ‘theme_hitchcock’ ),
‘id’ => ‘sidebar-1’,
‘description’ => ”,
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ”,
‘after_title’ => ”,
) );
}In index.php and singular.php , I have
<?php get_header(); ?>
<?php if ( is_active_sidebar( ‘sidebar-1’ ) ) : ?>
<ul id=”sidebar”>
<?php dynamic_sidebar( ‘sidebar-1’ ); ?><?php endif; ?>
But the sidebar does not appear.
Forum: Themes and Templates
In reply to: [Hitchcock] adding a sidebar widgetHi Anders,
Ok, thanks for your reply.
I am a little bit new to wordpress. Do you know if it is possible to add widget areas?Peter
Forum: Themes and Templates
In reply to: [Hitchcock] how to change the padding in the content sectionHi Snehal,
Thank you very much.
That worked!But how did that work? I would not have guessed to use “width: 100%”
Peter
Hi Jeff,
I solved the issue with help of using PHP remote debugging to PHPStorm as the IDE. It was stripping it off at the basename function in the usp_attach_images function.
The solution is to use the setlocale function like in the following
function usp_attach_images($post_id, $newPost, $files, $file_count) {
setlocale(LC_ALL,’en_US.UTF-8′);Thanks.
Peter
Oh sorry, I got the words reversed.
I meant wp_handle_upload.
Thanks.
Hi Jeff,
I was just checking out the code where it might be stripping off the unicode characters.
I see that you have apply_filters(‘wp_upload_handle
Do you think that it might be stripping off the unicode characters in user-submitted-posts.php ?
Thanks.
Peter
Hello Jeff,
Interesting.
I tested it myself just now and I found the same results. However, I have to add some English text like you did in order to get it to not strip off the Chinese characters. If you use just straight Chinese characters like “上傳照片.jpg” I think you will find that it will strip off the Chinese characters.
Thanks.
Peter
By the way, I think uploading the image attachments and then changing the name would be a pretty good suggestion. For example, the new file name would be changed to an iso date and time format like ‘201812070001.jpg’. I have found the article below which describes how to do it. I have tried it out before by putting the action hook to the function.php of my theme, but the problem is that it does not work along with your [user-submitted-posts] shortcode that can also change images to thumbnails.
https://wordpress.stackexchange.com/questions/30313/change-attachment-filename
I made a donation for your troubles.
Thank you for your efforts.
Hello Jeff,
I am looking at file names with Chinese characters.
If you copy the characters below and use it to rename a file and upload the file. You will find that it strips off the Chinese characters leaving only the file extension.
上傳照片
Thanks.
Peter
Hi Jeff,
Thanks for the reply, but actually, it does not support uploading of an image file name with unicode characters in it. The image goes into the database and gets uploaded, but it strips off the unicode characters. So for example if we upload a file like <unicode character name>.jpg, It will strip off all of the unicode characters before making a copy of the file in the “uploads/<year>/<month>” folder leaving only the extension of the file .jpg in the folder.
Peter