Load post content into iframe

Not sure, but I think ajax solution would be more apropriate. But anyways, if I understand this corectly, you have an archive where full posts are loaded inside iframe. If this is a case you can modify template file (single.php) and remove header and footer take a look at Template Hierarchy for further reading I … Read more

How will php 7 affect WordPress?

WordPress has been preparing for PHP 7 for a while and, according with this announcement, WordPress should support PHP 7 since November 12th. According with the same announcement WordPress will still supoort PHP 5.2.4 as minimun requeriment, although it is recommended at least PHP 5.6. The downside: there are propabably so many plugins and themes … Read more

How to get the registered sidebar’s name by its id?

Sidebars are stored in global variable $wp_registered_sidebars. You can get the sidebar properties using this variable. global $wp_registered_sidebars; if ( isset( $wp_registered_sidebars[‘sidebar-2’] ) ) { echo $wp_registered_sidebars[‘sidebar-2’][‘name’]; } Note that do not use it too early, either on/after widgets_init hook or in a template file.

Should the value of core functions be escaped before outputting?

The WordPress Codex says: It’s important to note that most WordPress functions properly prepare the data for output, and you don’t need to escape again. For example the_permalink() already escapes the output with: echo esc_url( apply_filters( ‘the_permalink’, get_permalink( $post ), $post ) ); so you don’t need to do that yourself here. But the get_the_permalink() … Read more

Does the REST API (official) support custom post types?

Thanks for the clarification in the comments. The confusion is between the WordPress.com hosted API and the WordPress.org REST API project, which are different. The WordPress.com API was developed by Automattic and is only available for websites hosted on the WordPress.com platform. There’s some overlap in functionality, but that’s not the documentation you’re looking for … Read more

Modifying widget search box

The default Search widget uses the get_search_form() core function to display the search form. You can therefore edit the search form’s action <form role=”search” method=”get” class=”search-form” action=”http://domain2.com”> in the child theme’s searchform.php file. Here we assume domain2.com also supports the default WordPress search parameters. If we don’t want to modify the file, we can adjust … Read more

Redirect to Page after Post Submit

You can’t. If you wish to redirect a user by PHP, you should set the response header. If you output any data, you will not be able to, and you will get a Header already sent error. Look at this line: wp_redirect( home_url(‘/?page_id=7’) ); exit; echo $result; die(); When you use exit ( which is … Read more

Wrong UTC and local time only on wordpress

This might be a solution for you: https://wordpress.org/support/topic/utc-time-and-local-time-problems/ It says that it’s a problem with PHP config, not WordPress. (Bringing the solution here for ease of reference) If you have shell access, do you get the correct date/time when you type “date” at the command line? If that’s wrong, contact your host. Try adding the … Read more

Removing jQuery migrate and working with dependencies

First part… OK, so in your theme/plugin you have: wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘scripts’, get_template_directory_uri() . ‘/js/scripts.min.js’, array( ‘jquery’ ) ); The first line, enqueuing jquery isn’t necessary – you put jquery as dependency in second line, so it will be included anyway. These lines inform WP that you want to enqueue given file as … Read more