add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'primary-menu' => __( 'Primary Menu' ),
'secondary-menu' => __( 'Secondary Menu' ),
'tertiary-menu' => __( 'Tertiary Menu' )
)
);
}
and header2.php:
<?php wp_nav_menu( array( 'theme_location' => 'primary-menu' ) ); ?>
However, even without styling the menu in CSS, I’m not getting the defined menu I created in Appearance>Menus which I’ve called “Primary Menu”, instead I’m getting an ordered list of all pages. In addition, I’m still getting the “Your theme does not natively support menus, but you can use them in sidebars by adding a “Custom Menus” widget on the Widgets screen.” message…
Any ideas on what I’m missing here?
Thanks!
]]>In my sidebar loader:
define( OPTIONS_PAGE, add_menu_page('EMS Forms Options', 'EMS Forms', 'manage_options', PATH.'/EMSF_Options.php') );
In my main file:
add_action('admin_print_scripts-'.OPTIONS_PAGE, 'Add_EMSF_Options_Scripts');
And here’s the function that the main file is assigning the action…
function Add_EMSF_Options_Scripts(){
wp_register_script('EMSF_Options, plugins_url('emsforms/js/EMSF_Options.js'), array('jquery','jquery-form'), '1.0');
wp_enqueue_script('EMSF_Options');
}
Any help with this would be greatly appreciated. I suppose I could just let it load the script on every page, but I’d rather not, since it uses jquery’s ajax functionality every time it loads.
Thanks in advance.
]]>Example
domain.com/ – this installation cannot upgrade
domain.com/wp1/ – this installation I can upgrade
domain.com/wp2/ – this installation I can upgrade
etc…
]]>we are having at work really serious troubles with WordPress and Akamai. We are running a multisite (network) 3.0.5 install, with subdirectories. Here are the URL’s:
The problem we have is that, while everything is pointing to https://municipios-origin, the Akamai url is https://municipios… but in the source code of *everything* under https://municipios, it refers to https://municipios-origin (plugins, images, permalinks, etc…), so CDN is not working, because it loads everything from our server directly.
We are at the same time, running an Akamaized WPMU 2.8 (not updated) and everything works properly, without doing anything (but changing the base URL)…
Please, can anyone have a look and help us? I have had a reply from someone from Akamai, that says the problem is on WP roof (https://www.quora.com/Akamai/What-is-the-configuration-for-using-Akamai-as-CDN-of-a-WordPress-3-0-Multisite)…
Can anyone help me? Let’s start a conversation, so it could be helpful for those we use Akamai CDN and WordPress.
Thank you very much in advance for your help.
Oscar Garcia C.
Code is Poetry.
I have an existing blog with hundreds of post. I’d like to retroactively introduce custom post types and taxonomies.
I have a very elaborate (and difficult to use) categorization scheme that should make this easy to do if I could just mass convert posts under a given category to a custom post types or custom taxonomy. (This is because different content types get their own categories [article, video,] as do different taxonomy types [people, places])
I’ve already created the custom post types and taxonomies that I need using the plugin custom post type ui.
The first step, changing the post type of certain posts, is easy to do by using the convert post types plugin. (It allows you to change the post type of posts under any category, which fits my needs perfectly.)
The second step, converting certain categories to custom taxonomies (say, a family of categories about politicians to a “politicians” custom taxonomy family) is proving to be bloody impossible. There doesn’t seem to be a category to custom taxonomy converted plugin out there, despite the obvious need for one by anybody looking to to apply WP3.0’s CMSing innovations to an already existing blog.
I’ve tried dicking around with the wp_term_taxonomy table in the WP SQL database. If I manually change the “taxonomy” field of different terms – from category to politicians, a custom taxonomy – all posts under that (former) category reflect the update. If you try to edit a post, the custom taxonomy meta-boxes display the right term. (I haven’t tried writing a custom loop to see if the posts would display on the site, so I don’t know if that works.)
The first problem is that if you go to the custom taxonomy page (the equivalent of the “category” or “post tags” page under posts,) none of the terms show up in the table at the right. If you SEARCH for them, though, they do show up. (Is there some other file that has to be edited
The second problem is that creating a custom taxonomy and associating it with posts (or any custom post type) doesn’t generate a filter box on the view posts page. This makes custom taxonomies pretty much unusable.
Does anybody have ideas on how to convert categories to custom taxonomies and how to add a taxonomy filter on the posts page?
Thanks!
]]>my javascript function is this:
function show_players_page(id)
{
jQuery()
{
var data = {
action: 'bbnuke_players_page',
bbnuke_player_id: id
};
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
jQuery.post( ajaxurl, data,
function( response )
{
alert(response);
}
);
};
}
my php function which is called is:
function bbnuke_show_players_page()
{
global $wpdb;
$player_id = $_POST['bbnuke_player_id'];
$user_id = get_current_user_id();
if (!$user_id)
$user_id = 1;
// create the page content
$bbnuke_post_content = bbnuke_widget_playerstats( $player_id, false );
$bbnuke_post = array(
'menu_order' => 0,
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_author' => $user_id,
'post_content' => $bbnuke_post_content,
'post_name' => 'baseballnuke-players-page',
'post_status' => 'publish',
'post_title' => 'baseballNuke - Players Page' . $player_id,
'post_type' => 'page'
);
$post_id = wp_insert_post( $bbnuke_post );
sleep(3);
$url = get_bloginfo('url') . '/?p=' . $post_id;
bbnuke_update_option( 'bbnuke_ajax_post_url' , $url );
exit;
}
in my plugin file is this:
add_action( 'wp_ajax_bbnuke_players_page', 'bbnuke_show_players_page');
add_action( 'wp_ajax_nopriv_bbnuke_players_page', 'bbnuke_show_players_page');
how I can send the create post_id back to the calling javascript function?
the response only contains “success: true”.
how i can set the responsetext or receive data from the server?
]]>I have the following wp-config settings:
define(‘VHOST’, ‘yes’);
//define(‘SUBDOMAIN_INSTALL’, true);
define(‘PATH_CURRENT_SITE’, ‘/wp_mu/’);
define(‘BLOGID_CURRENT_SITE’, ‘1’);
define( ‘WP_ALLOW_MULTISITE’, true );
//define( ‘MULTISITE’, true );
define( ‘SUBDOMAIN_INSTALL’, true );
//define( ‘DOMAIN_CURRENT_SITE’, ‘it-gnoth.de’ );
//define( ‘PATH_CURRENT_SITE’, ‘/’ );
//define( ‘SITE_ID_CURRENT_SITE’, 1 );
//define( ‘BLOG_ID_CURRENT_SITE’, 1 );
define( “WP_USE_MULTIPLE_DB”, false );
I got the message that VHOST is deprecated and I should use SUBDOMAIN_INSTALL instead.
If I set this to true the whole installation is no more accessible and I get a message that the database connection is not possible.
Has anyone an idea how to set those constants?
]]>I hope this is the proper place to post this question. And I hope it hasn’t been covered elsewhere. I tried many variations of a search and did not find this particular question. Maybe its so obvious to skilled users it isn’t necessary. In that case I apologize.
As a CMS I am finding WP3.0+ to be very good but of course it is still maturing in this role. For my usage its Achilles heel is the sharing of content amongst a related group of blogs/sub-domains. NextGen Galleries works pretty well for pics.
I would like a post from one blog to be displayed in the post of a different blog. This is simaler to the way external pics are grabbed and displayed. Even that though creates a new page permalink which looks like duplicate content. I would like to reuse the originating post link within the second blogs structure. Primarily I want to avoid upsetting Google analytics search for original content, not repeated content duplicated between blogs.
Of course I can copy/past or export/import or create external link which jumps out of the current blog back to the originating blogs site and post.
Thanks and my apologies if this turns out to be a completely simple and lame query.
GSW
]]>Any ideas?
www.prep4practice.com
]]>