Featured Post

What is the purpose of the php.ini file?

  The PHP configuration file,   php.ini , is the final and most immediate way to affect PHP's functionality. The php.ini file is read ea...

What are variables in PHP?

 Variables store data and always start with $.

$name = "John";

$age = 25;

Difference between echo and print?

 

echoprint
Can output multiple strings    Outputs one string only
Faster    Slightly slower
No return value    Returns 1

How to Integrate Google Tag Manager with Drupal 9 - An Easy Step-by-Step Tutorial

 Marketers are always seeking new ways to elevate website engagement and maximize interactivity. Yet, managing the countless third-party integrations and tracking tools implemented to enhance their business can quickly become overwhelming and chaotic. That's when Google Tag Manager comes to the rescue. With its intuitive and user-friendly platform, managing, updating, and tracking the snippets, tags, and integrations on your website has never been easier. From improving website performance to boosting conversion rates, Google Tag Manager offers the solution to streamline your digital marketing efforts and revolutionize your online presence.

Drupal 9 makes integrating with Google Tag Manager easy and effortless. The Google tag manager module in Drupal lets you quickly add, modify and remove tags on your website without touching any code! Read this easy step-by-step guide to learn how to integrate your Drupal 9 site with your Google tag manager.

GTM with Drupal

What is the purpose of the php.ini file?

 The PHP configuration file, php.ini, is the final and most immediate way to affect PHP's functionality. The php.ini file is read each time PHP is initialized. in other words, whenever httpd is restarted for the module version or with each script execution for the CGI version.

How do you enable error reporting in PHP?

 PHP allows us to choose whether or not to display errors to users. There are three ways to enable or disable error reporting in PHP:

Method 1: You can turn the display error parameter in the php.ini file on or off. When it’s on, errors are shown; when it’s off, there are no errors shown or reported. To do this, locate the display error parameter in the php.ini file, then set its value to “on.” Restart the web server's various services. The PHP script's errors will now be visible to end users. Set the display error parameter to “off” to stop reporting errors. The off argument indicates that users won't see any errors.

Method 2: Using the mini set() function is the second way to enable or stop error reporting. The ability to modify the configuration options in the php.ini file is a built-in feature of the PHP programming language. It requires two inputs: the name of the setting you want to change and the value you want to assign.

Method 3: You can also utilize the error reporting() function, a native PHP function, to enable error reporting. This function controls which PHP faults are reported and sets the error reporting directive during runtime. Given that PHP has multiple error levels, this method also aids in setting the various levels for the runtime (duration) of your script. This function accepts parameters for error names like E ERROR, E WARNING, E PARSE, etc., allowing these errors to be reported.

Sachin vs South Africa Highlights HD🔥 First ODI Double Century hitter | India | Full Match Video

 




How to Create Custom Post Types in WordPress

 We only get three built-in content types at the backend when we install WordPress, i.e., posts, pages, and media. However, today WordPress has become quite flexible and advanced.

The approach to adding more post types also has expanded. The diversified usage demands more content types because posts, pages, and media are not enough, and here is where WordPress custom post type comes in handy.

What Is a WordPress Custom Post Type?

Custom post types are used to convert a regular WordPress website into a content management system. As the name suggests, you can use custom post types to create various content types for your website.

Besides that, one can find several post types available by default in WordPress installation, including:

  • Post – blog post
  • Page – static page
  • Attachment – attached media
  • Revision – post revision
  • Navigation Menu – nav menu
  • WordPress supports an unlimited number of Custom Post Types. You can create your custom posts and call them up wherever you want.
  • For example, if you run a News website and want to add a custom post type titled “News.” Once created, the news post-type would have its own menu in the WordPress dashboard admin area. Additionally, you can create multiple post types, such as Movies, Portfolios, etc.

What Is a WordPress Custom Post Type?

Custom post types are used to convert a regular WordPress website into a content management system. As the name suggests, you can use custom post types to create various content types for your website.

Besides that, one can find several post types available by default in WordPress installation, including:

  • Post – blog post
  • Page – static page
  • Attachment – attached media
  • Revision – post revision
  • Navigation Menu – nav menu
  • WordPress supports an unlimited number of Custom Post Types. You can create your custom posts and call them up wherever you want.

    For example, if you run a News website and want to add a custom post type titled “News.” Once created, the news post-type would have its own menu in the WordPress dashboard admin area. Additionally, you can create multiple post types, such as Movies, Portfolios, etc.

  • Follow the steps below to create a custom post type on a WordPress website:

    • Navigate to the function.php file from your WordPress theme directory
    • Add the following code to the function.php file
    1. /* Custom Post Type Start */
    2. function create_posttype() {
    3. register_post_type( 'news',
    4. // CPT Options
    5. array(
    6. 'labels' => array(
    7. 'name' => __( 'news' ),
    8. 'singular_name' => __( 'News' )
    9. ),
    10. 'public' => true,
    11. 'has_archive' => false,
    12. 'rewrite' => array('slug' => 'news'),
    13. )
    14. );
    15. }
    16. // Hooking up our function to theme setup
    17. add_action( 'init', 'create_posttype' );
    18. /* Custom Post Type End */
    • Once you’ve added the code, the News post-type will automatically appear in the admin area

Popular Posts