I can't login on admin page after i update wordpress - wordpress

when i try to login ,displayed this: Fatal error: Call to undefined function add_menu_page() in /home/u613978711/public_html/wp-content/themes/mytheme/panel/mpane
before showed, on plugins, but when i remove plugins from FTP, now show this on THeme, how can i fix, and how can i update wordpress without any problem

#Maulik's Answer above is correct, Also you may try the following below:
Login from FTP and goto wp-content/themes and rename your theme with some other name. Once you are done, Open your home page, It'll force wordpress to apply the default theme. (Don't worry you can apply the theme again in Appearance > Themes). And try logging in again. It should work now.
If successful, Try applying the theme again.

Update the Wordpress Version so Function.php file is changed
so please create the hook
<?php
add_action('admin_menu', 'my_menu');
function my_menu()
{
add_menu_page('My Menu', 'My Test', 'manage_options', 'my-page-slug', 'my_function');
}
function my_function()
{
echo "Hello";
}
?>

Related

After editing my wordpress website's footer copyright credites using My Custom Functions plugin, my site is down

I am making a wordpress store using storefront theme named Pakoutfit.com.
I tried to edit its footer credentials using My Custom Functions plugin and using this plugin I run following code,
add-action( 'init' , 'custom_remove_footer_credit' , 10 );
function custom_remove_footer_credit(){
remove_action( 'storefront_footer' , 'storefront_credit' , 20 );
add_action( 'storefront_footer' , 'custom_storefront_credit' , 20 );
}
function custom_storefront_credit(){
?>
<div class="site-info">
© PakOutfit <?php echo get_the_date( 'Y' ); ?>
</div>
<?php
}
I do that following this youtube tutorial,
Now when I tried to open my site or even its wp-admin panel it says,
This page isn’t working
pakoutfit.com is currently unable to handle this request.
HTTP ERROR 500
I dont know that in which file My custom Functions plugin make changes so that I can reverse them.
I am using godaddy domain name and hosting.
I am new in this field. Please help me to make my site live again. Thanks
Modification to your site should be made via a WordPress child theme. Do not edit core theme files: https://codex.wordpress.org/Child_Themes
Using your FTP or cPanel login, locate the file where you made the changes and remove them. That will restore your site.
Once you have your child theme installed and activated, and your function to the child theme functions.php file.
Be sure to change this:
add-action
To this:
add_action

Wordpress [ ] tags?

I'm very new at wordpress and I'm trying to understand a code from a friend. I went to his wordpress account and edit some test page. However, the page has code inside [ ] tags. How can I edit it?
Here is an example from the wordpress wdit page:
<p style="text-align: center;"><strong>Test- #1 Business Communication App For Project Management & Task Management</strong></p>
<strong>Important Notice:</strong> If you accessed ....</strong></em>, in order for your account to be properly updated.
[register_form]
How can I open/edit the [register_form] code?
This is a shortcode from a plugin or from your theme.
Edit
You can edit it in your theme. If the shortcode is from a plugin, you can overwrite it in your functions.php
function say(){
return "Hello World";
}
add_shortcode( 'register_form', 'say' );
are the tags used to call a function of some plugin that you have active. that specific tag I do not recognize what plugin is, I recommend Contact Form 7, it is easy to use.
If you want to create a PHP function and use it on your page, create a plugin and declare the call as you want. But! Be careful as an error however small will damage your page.
for add tag on wordpress, from your plugin.
function NAME_FUNCTION(){...}
add_shortcode( 'NAME_FUNCTION', 'NAME_TAG' );
and call
[NAME_TAG]

wordpress, adding a settings action link under my plugin's name for my plugin

I'm trying to develop my first plugin for wordpress. I noticed that other plugins I have installed on my wordpress have a link to the plugin setting page right from the plguin page list of plugins.
so right under my plugin's name I see:
Deactivate
but for some of my other plugins I also see a
Settings
link that will take the user right to the settings page of that plugin.
How can I tell wordpress I want such a link for my plugin?
I use this hook to add my settings page:
add_action('admin_menu', 'my_plugin_admin_add_page');
thanks
Please add the following code to the plugin file.
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'my_plugin_settings' );
function my_plugin_settings( $settings ) {
$settings[] = 'Settings';
return $settings;
}

Wordpress plugin shortscodes in other plugins?

I'm developing a plugin that creates custom wordpress pages, however I ran into a problem when trying to get shortcodes from other plugins to integrate into my plugin, well more like I couldn't find any info on it.
For example if someone uses my custom page builder and adds a short code [gallery] that is associated with an enabled plugin, I want the shortcode to do it's thing.
Could anyone point me in the right direction for this?
Try wordpress
http://wordpress.org/plugins/synved-shortcodes/
while this plugin let's you integrate shortcodes on every wordpress page , I suppose that you issue is with wordpress functions.php file where you can have a look at , with this plugin installed !
You can check if a shortcode exist before printing it with the function shortcode_exists() (https://codex.wordpress.org/Function_Reference/shortcode_exists)
Example:
<?php
if ( shortcode_exists( 'gallery' ) ) {
// The [gallery] short code exists.
}
?>
Then, if it exist and you want to print that shortcode with PHP code you should use do_shortcode() function (https://developer.wordpress.org/reference/functions/do_shortcode/)
Example:
<?php echo do_shortcode('[gallery]); ?>
Always use in WordPress's in-built
the_content
hook to print your custom page content.
WordPress by default process all shortcodes before outputting any stuff from this hook.
More info can be found here: https://codex.wordpress.org/Function_Reference/the_content

why is the <?php wp_head ?> tag creating a top margin at the top of my theme header

Hey people, I've been coming here for a while but just decided to join.
I'm new to php and I'm trying to make a website with WordPress as the CMS.
Anyway, I'm basically making my own theme because I don't want my website to look like a blog, and it's going pretty smoothly so far but theres this huge top margin gap in the browser even when I set margins to 0px.
I tried trial and error and found out that it's being caused by: <?php wp_head(); ?>
It's two different things.
1. wp_head() function
wp_head() is a template tag to print whatever plugin / theme specific function used by wordpress action. Read codex for more detail about it.
2. The admin bar
The top margin, is generated by wordpress's admin bar.
To fix this for logged in users you can do a couple of things:
Disable admin bar from the admin:
Go to admin panel
Users >> User Profile
Uncheck 'when viewing
site' on 'Show Admin Bar'
Remove the admin bar from your theme entirely:
Open your functions.php
Add this to it:
function my_function_admin_bar(){ return false; }
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
Remove only the code which creates the css:
Open your functions.php
Add this to it:
function my_filter_head() { remove_action('wp_head', '_admin_bar_bump_cb'); }
add_action('get_header', 'my_filter_head');
Note: Extensive updates are from #hitautodestruct
you neeed to call wp_footer() in your footer
just insert this line <?php wp_footer();?> into your footer.php file
If you have updated your wordpress install to the latest version.. there seems to be some bug with the admin bar...
were it would produce an inline stylesheet appended to the top of your pages.. causing the margin-top:28px
see here
1 recomendation is to put a new function into your functions.php file located in your theme folder.. this will completly remove the bar, so no users of your theme will have any of the same issues!
function my_function_admin_bar(){
return false;
}
add_filter( 'show_admin_bar' , 'my_function_admin_bar');
Not sure if this will help.. but worth a shot.. also turning off the admin bar while viewing the front end of the site under your profile page..

Resources