Adding php within a return statement [closed]

You can just call PHP functions directly. In this case however we possibly don’t want to call the_permalink() since it echoes out the link: function the_permalink( $post = 0 ) { /* … */ echo esc_url( apply_filters( ‘the_permalink’, get_permalink( $post ), $post ) ); } whereas we want to return the link in a string. … Read more

Setting different CSS for all pages except home.php

Instead of <?php if(!is_home() || !is_front_page()) :?> you could use <?php else: ?> This style will not affect the wp-admin part, only the front end of your web since this is used in header.php. A safe way is to use wp_register_style() and wp_enqueue_style() as described here in the Codex: http://codex.wordpress.org/Function_Reference/wp_enqueue_style http://codex.wordpress.org/Function_Reference/wp_register_style In your case it … Read more

How to Create a Multi Purpose Theme?

The way I do it is create multiple layout files, add the option to choose which one to use on the template options panel: layout-left.php layout-right.php layout-both.php Then on the index page you setup if layout X is chosen, load X layout. This is an example using the option tree plugin theme options: <?php get_header(); … Read more