Check if sidebar is active on page with id
You mean like this: if (is_active_sidebar($sidebar-name) && is_page($page-id)) {do your thing} ?
You mean like this: if (is_active_sidebar($sidebar-name) && is_page($page-id)) {do your thing} ?
For editing content, I used the plugin Advanced Custom Fields. As for the conditionals, I just added if (is_page_template(‘template_name.php’) before each wp_enqueue_script.
It is normal to have some text used in template. Typically that would be pieces of “technical” text, related to interface and which must be in code to be localized. In solutions meant for public use it is certainly not normal practice to have actual content hardcoded in templates. For private projects it is more … Read more
From your question I understand that inside the top level page you want to indicate which child page to include. The obvious way to do this is using a shortcode. So in your functions.php you would have something like this: add_shortcode( ‘insert_child’, ‘wpse240522_insert_child’ ); In the content of your top level page you would have … Read more
There is a function get_page_children available for this purpose, have a look on the documentation and examples. https://codex.wordpress.org/Function_Reference/get_page_children
The only way is to use the filter in the Recents from developer.wordpress.org WP_Widget_Recent_Posts::widget $r = new WP_Query( apply_filters( ‘widget_posts_args’, array( ‘posts_per_page’ => $number, ‘no_found_rows’ => true, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => true ) ) ); Best way will be, to add a category to the post your submit from frontend. add_filter(‘widget_posts_args’, ‘wpse_244383’); function wpse_244383(){ … Read more
The press_this_save_post filter can be used to change the post type from post to page. Add the following code to your theme’s functions.php or a plugin: add_filter( ‘press_this_save_post’, ‘wpse244633_press_this_save_post’ ); /** * Filter the post data of a Press This post before saving/updating. * * @param array $post_data The post data. * @return array */ … Read more
It is impossible to guess what is breaking your site without hands on debug. In general to debug redirect issues I always recommend Better HTTP Redirects plugin, which has debug mode to stop redirects in process and help figure out which code is generating them.
You didn’t say how you were going to implement the code: If you are using page templates or custom post pages, you could do this: <?php $user_id = get_current_user_id(); if ($user_id == 0) { echo ‘You are currently not logged in.’; } else { echo do_shortcode(‘[pods-form name=”user” id=”‘.$user_id.'” fields=”my_field, my_field_2, my_field_3″]’); } ?> are you … Read more
You need to have the possibility of editing that content from admin and it should be SEO friendly and you are using Yoast? Right? Then I think Page Templates is the best way to do your task. You can change the content from Admin panel (I assume that you mean the code as a content.). … Read more