Unique Page Sidebars Is not working

While working on wordpress to develop any website you may need to create dynamic sidebar for different pages, custom post type. You can use Unique Page Sidebar wordpress plugins from wordpress plugins repository for free.

It works for perfectly on default wordpress single page also on different archive pages.
For custom post type if you are using this plugins like you created a custom post type page template with custom query you need to make sure that you reset your query at the end of post looping.

If some how Unique Page Sidebars is not working on your custom post type template page then you need to make sure that you used wordpress reset query like below.


Upload featured image on custom post from wordpress front-end

When you are working with wordpress custom post type and you need to allow user can submit new posts where On each post you need to upload photo of the post also that can be a featured image then you need to follow below codes to upload attachmends and to make it featured.

//Just uploading photo or attachments
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
         

//$file_handler = 'upload_attachment' //Form attachment Field name.
$attach_id = media_handle_upload( $file_handler, $post_id );


//making it featured!
set_post_thumbnail($post_ID, $attach_id );
or
update_post_meta($post_id,'_thumbnail_id',$attach_id);

404 Page Not Found after custom form submission on wordpress

Sometimes it’s happen! when you submit a wordpress form it says ‘Page Not Found!’ or Saying ‘This is somewhat embarrassing, isn’t it?It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.’

But your defined page action has a valid url and all post values are available too on that same page. Also if you submit that form as empty input that it works fine!

If this is the case then The problem is by the “name” parameter you posted from your form. WordPress has some reserve parameter for internal use like client_name, author_name etc

So you just need to try with renaming your form fields. Hope it will solve it!

I got a BenQ FP72E Size 17-Inch LCD PC Monitor

Yes I got another web development device in my collection called BenQ FP72E Size 17-Inch LCD PC Monitor collected from Dubai. Before that I was using my Fujitsu LIFEBOOK L series LH531 model. So now you can say I can review or test my web development works on a larger display . Actually it’s not the major but it’s just useful when I need to test my work on a larger display. I will work on my laptop display normally and will test on it if required.

Another things optionally is, I love watching movie when I am a bit free or when I am too much busy with my programming work! I have a collection of movie around 120 above. It’s great to watch HD movie on this new 17-Inch LCD display. On my old one Fujitsu when I was watching a movie that was also perfect but not like now on my 17-Inch new monitor. I really love it!

Replacing media urls on wordpress posts

Sometimes we work for a website with wordpress keeping the development version on sub directory. Say are working for http://www.example.com website and currently it is live and we work for it’s new version in wordpress. So we setup a new wordpress version on new folder so the current development version is http://www.example.com/new

When we are done with all development and uploaded all contents on that new setup that means all media files and contents media urls are targeting with http://www.example.com/new

So when we are going to make the site live we need to do something manually to replace media paths for contents. Or if we directly copy contents from another hosting in that case same things will happen.

For the faster replacement of each media guid, contents media url or other meta values below mentioned 3 mysql query is nice.

Note: After running below code we need to ensure that all wp-contents/uploads folders contents are available as it was on new development directory.

update wp_posts set guid = replace(guid, 'http://www.example.com/new', 'http://www.example.com')

update wp_posts set post_content = replace(post_content, 'http://www.example.com/new', 'http://www.example.com')

update wp_postmeta set meta_value = replace(meta_value, 'http://www.example.com/new', 'http://www.example.com')

update wp_options SET option_value = 'http://www.example.com' WHERE option_name = 'home' OR option_name = 'siteurl';

 

With this above queries below listed things will happen –
1. Replace all resource or post guid
2. Replace all old media src url to new src url in post contents
3. Replace all meta resource url like image, video or audio etc
4. Replace site home page and siteurl url

Selecting diagnostic center as a project or software to develop

I have a pathology laboratory in Beanibazar, Sylhet Bangladesh for my Uncle Md. Yeakub-Ul Islam. Last few days we are deciding to develop that pathology laboratory to a complete diagnostic center. That is why my uncle saying me to develop a computer software by which we can manage it.

We are planning to manage below listed all sections of a diagnostic center like

  1. Reception
  2. Sample Collection
  3. Test Report or Report Printing
  4. Report Delivery
  5. Sales
  6. Reagent Stock Control etc

 

So, for our complete professional project development we are deciding to develop this project which will control a complete diagnostic center with above listed sections.

 

Work Flow of a diagnostic center:
Step 1: Patients come to lab reception section to do some medical diagnosis with a doctors prescription.
Step 2: Reception executive keep that patients record with list of test and print a voucher with patients record also keep payments record.
Step 3: Reception executive forward that patients to sample collection department.
Step 4: Sample collection complete and forward the sample to lab section and forward the patients to waiting room.
Step 5: After all medical test done, Lab executive needs to input all data with his/her computer screen for that invoiced patients.
Step 6: Lab report delivery executive prints the report.
Step 7: Finally report delivery executive deliver the report to patients.

 

So, based on above work flow of a diagnostic center we are going to do some system analysis and features listing on our next article. To be continued…..

how to make windows form application design looks like windows 7 – Enable Visual Styles

If you see any control visual looks is not just what it was looking on interface design mode (or windows style looks) like below 2 images

looks of interface design mode
Without Enable Visual Styles or Windows Classic Looks

Then It means you are skipping a method call from System.Windows.Forms Namespaces, that is EnableVisualStyles

To Enables visual styles or operating system like controls color, fonts and other visual elements for your application just use below code before application run on Main method.

Application.EnableVisualStyles();

as below

[STAThread]
static void Main()
{
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
}

Returning a value to parent form from sub or popup form with C Sharp .net

It is a common features you may need it several times when you are on the way of a professional C# application development.

Suppose you have a Parent form which has a Textbox control and a Button control. Now you want to click on the button Control then it will open a Sub form or a PopUp form. In which there will be another button or any other control for example DatagridView and you want to click on it and it will return a value to it’s Parent form and that value will display on Parent forms TextBox control as text property.

You can do it by below listed steps.

Step 1 (Parent Form Code):
On parent form button control click event you can call your sub form like below code to open it and get it’s returning values from it’s predefined properties and use it for your textBox control as below.

private void button1_Click(object sender, EventArgs e)
        {
            frmSubForm objSForm = new frmSbFOrm();
            if (objSForm.ShowDialog() == DialogResult.OK) 
            {
                this.txtParent.Text = objSForm.StringProperty;
            }
        }

Step 2 (Sub Form Code):
On the sub form which one is opening after the click on button control of Parent form you can write below code for any events to return the value and exit sub form.

private void button1_Click(object sender, EventArgs e)
        {
             this.StringProperty= "Sample String";
             this.DialogResult = DialogResult.OK;
        }