rewrite

wordpress post name Permalink for localhost

If you getting trouble on running the wordpress system in your local system with post-name permalink than it is the problem of that your local server has disable the “rewrite module”.

For enable the “rewrite module” in your server you need to edit app-ache module stetting. So, after enaled this module you need to restart the server and then set post-name permalink from your wordpress system through admin panel and access any wordpress page or post you will see the permalink with post-name.

Read More

Disallowed Key Characters In Codeigniter

This may occur because of cookie problem for your browser so for removing this error you need to test this url in separate browse or clear the cookie for your browser.i if you use google chrome than press ctrl + shift + n so that take you on new google chrome instance at where you can see that your link may work.

The cookie is __utmt. A Google Analytic cookie. The ~Number part probably means it’s a copy/duplicate. Think of it like the word.doc~1 files that are stored on your computer when working in a Word doc.

So first, check your Analytic code on the website, is the a duplicate somewhere? My problem was solved by altering this duplicated line:

Weird thing is that the file always had this duplicated line of code, for as far as my GIT goes back. It might be a change in the way analytics code handles cookies…

Oh, and the “Disallowed Key Characters” part. That’s normally a good thing, protecting your CI app against evil.

Its in the system\core\Input.php file.

Read More

custom post type in wordpress

Custom post types are new post types you can create. A custom post type can be added to WordPress via the function like register_post_type() . This function allows you to define a new post type by its labels, supported features, availability and other specifics.

Please make sure that you must call register_post_type() before the admin_menu and after the after_setup_theme action hooks. A good hook to use is the init hook.

Here’s a code sample for adding a custom post type:

Here we have created the custom post type as “cpt_team”. In which you can set your labels and accessibility.
Now we will add addition field by using add_meta_boxes.

So up to now we have created the UI for custom post type with additional field. now for storing the data of custom field like facebook link in our example in database for particular post than we need to put following code.

Now you can see in your WordPress admin panel that there there is “Our team” menu in left sidebar and after click on that you can add member and save the data related to member with custom field like Facebook link and you can also list the member data.

Read More

how to add wordpress page in admin without menu

For creating the wordpress admin page that you not need to add this in admin panel menu than follow the below step.

Key point : create sub menu with blank parent.

1) create the action for admin panel.

2) call the function add_submenu_page in which the first parameter is parent page. in that perticular case set it as blank means you need to set parent page as blank.

The other parameter of the wordpress function “add_submenu_page” set as per your requrnment.

Read More