Tag Info

New answers tagged

0

Yes, content is not showing in editor. And there is no content in any of template files as well. Actually Website pages are already built by someone, and I want to edit some pages content. I am site Administrator and have Administrator rights. Some pages have been built by administrator and I can edit content of these pages successfully. But some pages ...


0

The hook to use here is admin_notices. However in register_activation_hook and register_deactivation_hook it shouldn't be used because these function run when plugin activates and deactivates instance. A workaround it we use add_option when plugin activates and delete_option when plugin deactivates. Here is the code. Hopefully you will understand it ...


0

So, the content is not showing in the WSIWYG editor? if thats true, is the content in any of the template files?


0

You can take the following steps Go to You Dashboard Click Appearance > Menus Under Pages, Click View All There will be a 'Home' option Check that Home Option Click 'Add to Menu' The new Menu item will appear in the right block Drag the home menu to the top Save the menu


0

By default, the page post type does not show the excerpt box like posts, but you can enable it like this(code goes into your theme's functions.php file): add_action('init', 'excerpt_for_pages'); function excerpt_for_pages() { add_post_type_support( 'page', 'excerpt' ); } Then you can see the excerpt field when you edit your page. If not, make sure it ...


1

You're looking for: _wp_link_page( $page_number ); Must be used inside loop, and it return the opening tag: http://wpseek.com/function/_wp_link_page/


0

I'm don't know a way of re-using the page picker but you could achieve what you're trying to do with the "Post Object" field type in the Advanced Custom Fields plugin. The post object field creates a select field where the choices are your pages + posts + custom post types. This field is useful for advanced linking to another page / post. ...


0

The theme's style sheet uses the reset method to set all margins on the <p> tag (and many others) to 0 (this is common practice). So you would need to add a style declaration into your style sheet to add the top and bottom margin back in for the <p> tag. For example: you could add this to your style sheet after the reset. p { margin: 10px 0; } ...


0

You need to use the post__in parameter and pass an array of the page ID's to the parameter. You can do the following: (Note: you need to use the array syntax in WP_Query if you pass post__in as an argument) <?php $the_query = new WP_Query( array( 'post_type' => 'page', 'post__in' => array( 1, 2, 3 ) ) ); ?> Just change 1, 2, and 3 to the ...


0

I figured it out, after trying a million things I tried one more, super stupid but it worked, I just went to permalink settings, clicked save changes and my posts and pages are working again... I don't understand why but finally it's working again.


0

Please check with other themes also. If it is a problem with the current active theme, rectify it at the theme level. First activate a default theme provided by WordPress. If it is working fine, then the issue is with your theme.


0

I am not exactly sure what you're question is but I think you are looking for something like this, mostly cribbed from the Codex: if ( is_active_sidebar( 'sidebar-1' ) ) { ?> <ul id="primary"><?php dynamic_sidebar( 'sidebar-1' ); ?> </ul><?php } If the sidebar is not in use, no markup will display. You could add ...


0

Assuming that those users have accounts on your site (are subscribers, authors, or some other role), you can add custom fields to their profiles. The easiest way is to use a plugin, like Advanced Custom Fields (https://wordpress.org/plugins/advanced-custom-fields/). The fields would be available in their profile pages, and you can add, and use in any ...


4

You would rather want to use the post ID inside the loop to target your pages. is_page() simply checks whether the current page is actually a page or a specific page if a value is passed Example if ( $post->ID === 7 ) { // Do something for page id 7 } else { // Do something for other pages }


0

I used User Role Editor a couple of times and is pretty good. Maybe it could help you too. Here is the link User Role Editor


2

I needed to do something very similar for one of the plugins that I was developing. I registered two separate cpt's during plugin activation, and each of those cpt's should use a custom single template that I had bundled with the plugin code base. You should be able to do the same for page templates, using the page_template filter. Here is my function ...


0

You can uncheck Settings >> Discussion >> “Allow link notifications from other blogs (pingbacks and trackbacks) to disable disable for future posts. However, to disable for exiting posts you need to run a SQL query on your database to turn the ping_status to OFF: UPDATE wp_posts SET ping_status='closed' WHERE post_status = 'publish' AND post_type = 'post'; ...


1

I found that in the documentation for wp-cli it says [--<field>=<value>] Associative args for the new post. See wp_insert_post(). Which then subsequently shows: 'page_template' => [ <string> ] // Requires name of template file, eg. template.php. The command is wp post update 4 --page_template='new-home.php'


1

As you assure me that the post title is an accurate indicator of the "duplicate" status of the post, a little bit of SQL and wp_delete_post() will do it: $sql = "SELECT ID FROM {$wpdb->posts} WHERE post_title REGEXP '^.*-[[:digit:]]*$' AND post_type = 'page'"; $del = $wpdb->get_col($sql); foreach ($del as $d) { wp_delete_post($d); } As ...



Top 50 recent answers are included