Jump to content

codexpower

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by codexpower

  1. i am a beginner and learning wordpress. Codex is not for beginners the information there is in the form of notes, something that is very difficult to be grasped for any beginner.

     

    I have few question, This is from header.php - 

    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    	<head>
    		<meta charset="<?php bloginfo('charset'); ?>">
    		<meta name="viewport" content="width=device-width">
    		<title><?php bloginfo('name'); ?></title>
    		<?php wp_head(); ?>
    	</head>
    	
    <body <?php body_class(); ?>>
    	
    	<div class="container">
    	
    		<!-- site-header -->
    		<header class="site-header">
    			<h1><a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1>
    			<h5><?php bloginfo('description'); ?></h5>
    		</header><!-- /site-header -->
    

    Why is this part used twice - 

    <?php bloginfo('name'); ?>

     

    First in head section - 

    <title><?php bloginfo('name'); ?></title>

     

    then in Body - 

    <h1><a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a></h1>

  2. I found a very beautiful tutorials on tuts - 

    http://code.tutsplus.com/tutorials/creating-your-own-widgets-using-various-wordpress-apis-introduction--cms-22460

    <?php
    class TutsPlusText_Widget extends WP_Widget {
         
      // widget constructor
      public function __construct(){
         
      }
        
      public function widget( $args, $instance ) {
        // outputs the content of the widget
      }
        
      public function form( $instance ) {
        // creates the back-end form
      }
        
      // Updating widget replacing old instances with new
      public function update( $new_instance, $old_instance ) {
        // processes widget options on save
      }
       
    }
    

    But they have not clarified that where will this go. I mean in which file. I believe it should be themes functions.php. Can some one comment Please?

  3. What I remember from my college days is that isset check whether the variable has a value set or not and return true or false value.

     

    However I encountered a code in wordpress - 

    // Set up the content width value based on the theme's design and stylesheet.
    if ( ! isset( $content_width ) )
    $content_width = 625;
     
     
    Here why is this sign used !
     
    This sign is actually not equal to, Right?
     
  4. First and foremost, add_action() and add_filter() are WordPress hook functions - they're specialized global functions that allow the developer to inject a custom function into the core functionality at specific points. So, in your case, at the point that the WordPress core calls after_switch_themes, it will call the user-defined function after_switch_theme_example(). This, by the way, a simplified explanation...

     

    Keep in mind as you're learning: WordPress - from a modern programming point of view - it's really not very well written. The reliance on global variables and functions, and some of the ways in which what classes there are are used is just backwards and old-fashioned. From an end-user point of view, it's great - it allows you to do a lot of things for very little effort. However, it can become rather frustrating quickly as you develop for it. And as far as PHP books and tutorials go, there's a literal ton of them out there but you need to be a little careful because a lot of them are old and PHP has changed a lot in the last several years. If you see a lot of $_REQUEST variables, the keyword global, or any kind of hashing using md5, just assume it's out of date and won't be of much practical help to you. I don't know of any good beginner tutorials or books right off the top of my head, but hopefully someone can kick in with an example or two for you.

    @maxxd,

     

    Thanks Boss that was awesome and very helpful to me.

  5. I know some basic PHP from my college. I wanted to learn WordPress, but before jumping into wordpress I think I should expertise PHP functions and arrays because that what mostly used in WordPress. 

     

    Can you recommend me some books/resources where advanced level PHP functions and arrays are discussed. Main Focus is PHP Functions, advanced level.

  6. Looking the wordpress function up in the wordpress docs might be helpful.

    I have learned some PHP in college. i think before jumping into wordpress I must master functions and array. I know basic, Can you recommend some books where functions and arrays are discussed in details at advanced level.

  7. Yes, yes it is...

     

    @codexpower - the biggest thing is that WordPress is huge, and asking for tutorials on how to <airquotes>program for it</airquotes> really isn't the way to go. If you've got a specific issue with a theme or plugin you're currently using that you want to fix or improve upon, start by working on just that issue. Basically, give yourself a project and set yourself a goal, then use PHP.net, the WP codex, and the many tutorials on the web to work towards that goal. When you get stuck, then ask a specific question here.

     

    We're all more than willing to help, but we need to know what we're helping with, you know?

     

     

    Lets say this is a small function - 

     

    <?php
     
    add_action( 'after_switch_theme', 'after_switch_theme_example' );
     
    function after_switch_theme_example() {
        flush_rewrite_rules();
    }
     
    ?>
     
    Please help me to under these functions more clearly.
     
    In think this is not a function -
    add_action( 'after_switch_theme', 'after_switch_theme_example' );
     
    The two things in blue are some kind of parameters.
  8.  

     

    Actually Buddy I visited those WordPress Codex links, but the problem is it not easy for a beginner to learn directly from wordpress codex. If some video exists explaining those things that may help.

     

    I was willing to go with lynda.com, but there is no money back. what If I do not find what I am looking for. Your help is appreciated and will be further appreciated.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.