New answers tagged

0

Content includes the author user and comments (and probably more). Dumping just part of the DB as a way to export/import doesn't sound like a very robust idea. DBs are relatively small, and there is almost no reason not to export/import the full DB instead of trying to hack things.


0

You need to "include" the WordPress functions which then will convert your shortcode from [mycode] to the code you expect. You do this by including wp-blog-header and setting wp_use_themes to false, this then stops the header.php of the theme from being added. define('WP_USE_THEMES', false); require ('./wp-blog-header.php'); You will need to change the ...


1

Use wp_list_pluck to extract an array of IDs from your query, then pass those to is_page. $top_level_ids = wp_list_pluck( $top_level_pages, 'ID' ); if ( is_page( $top_level_ids ) ) { // do something }


0

FTP into your site and open up your wp-config.php file. Add this line: define('CONCATENATE_SCRIPTS', false); Make sure you add this before: /** Absolute path to the WordPress directory. */ if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/');


0

After reinstalling Wordpress the issue still wasn't resolved. The site was running on php7.0 what ended up being the cause of my original issue. Switching back to php5.6 did the trick. Site is back up and running again. Thanks for the help!


0

From my point of view you are trying to make a pagination on a page, which can also mean wordpress is trashing your page/paged var, this can be easily solved by adding a filter adding a custom vars page/paged add_filter('query_vars', function( $vars ){ //!!SUPER IMPORTANT!! - always *APPEND* $vars array (NOT re-assign) $vars[] = 'page'; $vars[] ...


0

The WordPress admin area uses capabilities to determine which user role can see what pages etc. You can use custom written code or several plugins to control to capabilities by each user. I'd suggest using the Members plugin for some easy control.


0

Assuming that you are talking about a custom post type the answer is right in the codex. Generate a template called single-{post-type}.php and WP takes care of the rest.


1

If you want to change the single page page-{page-slug} is a good choice if you want the page template for specific page only and not multiple pages. Check out his custom page template for specific page If you are talking about custom post type We can use single-$posttype.php , here $posttype is your custom post type slug. WordPress template Hierarchy ...


0

Pagination is result of combining two factors: page size and offset. In common case page size is constant and offset is page size times current page. Is it possible to build highly elaborate pagination you describe? Technically yes. That would be matter to adjusting page size and offset in a more elaborate fashion. However specific of such implementation ...


0

You mean like this: if (is_active_sidebar($sidebar-name) && is_page($page-id)) {do your thing} ?


0

Ok so I finally managed to get it working, my map now displays, thanks to you people. What I did is : I changed the path to the absolute path of the scripts. Indeed, using a relative URL was a bad idea. I have changed my script, which now looks like that : document.addEventListener("DOMContentLoaded", function() { map_init(); }, false); var map; ...


-1

If what you want is is a full page refresh then you don't need ajax at all and inserting the htt-equip html meta will do the trick <meta http-equiv="refresh" content="5" > (content is time in seconds IIRC) You just hook on wp_head and insert it. function wpse_228671_wp_head() { echo '<meta http-equiv="refresh" content="5" >'; } add_action('...


1

You're using the reserved public query variable name as your custom one. It can e.g. affect the canonical redirect by setting page_id and name for a different page. Change it to something else to avoid possible name collision, like kenan_video_slug: add_rewrite_rule( '^watch/([^/]*)$', 'index.php?pagename=watch&kenan_video_slug=$matches[1]', ...


0

If you are using Wordpress version 4.5 or greater, you can take advantage of the built-in MySQL function RAND(n) along with its seed value. As long as you pass the same n on each query, you will get the same set of random posts. As an example: $randomN = 123456; $posts = get_posts(array( //... arguments here 'orderby' => "rand($randomN)" )); ...



Top 50 recent answers are included