Single.php – Get Current Parent Category

The very broad answer for why this doesn’t work is that the internet is stateless. Basically each request for a page is a separate and unique instance from other page requests. Example Let’s say post-1 is in category-1 and category-2. When WordPress loads post-1 on single.php it has no way of knowing how the user … Read more

Pagination 404s on custom query

There are a couple of things I don’t understand here, but I’ll try answering them as I go along. You have a home.php, which I assume is your default homepage. You have one line of code in there, and that is to call a another page template. Here is you code <?php require dirname( __FILE__ … Read more

how to “not” display new posts with a specific category on the main page?

There is even an example in the WordPress codex here for this: http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘cat’, ‘-3,-8’ ); } } add_action( ‘pre_get_posts’, ‘exclude_category’ ); Just modify the category IDs (replace -3,-8 by your category IDs preceded by the minus sign) and put it in … Read more

How to show latest blog post rather then earliest

There must be something playing with your query (using pre_get_posts) as the default in WP is to load the last created post. Use this WP_Query instead $the_query = new WP_Query( ‘posts_per_page=1&post_type=post’ ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); ?> <h4>Posted on <?php the_time(‘F jS, Y’) ?></h4> <p><?php the_content(__(‘(more…)’)); ?></p> <?php … Read more

WordPress Blog – Grid View

I use the masonry way at the end of my css; /* Masonry Custom CSS for the Grid Style Blog */ /* Masonry container */ body.blog div#content, body.archive div#content { -moz-column-count: 3; -webkit-column-count: 3; column-count: 3; -moz-column-gap: 1em; -webkit-column-gap: 1em; column-gap: 1em; max-width: 100%; margin-left: 20px; margin-right: 20px; } /* Masonry bricks or child elements … Read more

Where is Number of Posts Set?

That looks like a http://para.llel.us/support/ theme. You might start there for docs—for instance, they probably have a custom ‘Theme Options’ page in the admin. Short of that, and presuming you’re ok with setting it in code (which may negate any future settings in the admin), you’ll first need to find out where $blog_query is being … Read more

Is there a PressThis that doesn’t hotlink?

PressThis bookmarklet does upload images to the wp uploads folder that you add to the article. Basically in the PressThis window go to the ‘Add’ menu and click on ‘Insert an Image’ icon. It will populate thumbnails of images found on the web page you are on. Click on the image you want to include … Read more

Add excerpt and post thumbnail to Buddypress blog directory page [closed]

I don’t have a complete answer for you. But I can point out that you should use the filter hook provided in the function bp_blog_latest_post() So something like: add_filter(‘bp_get_blog_latest_post’, ‘your_function’, 1); function your_function( ) { global $blogs_template; $str = // build your string to include excerpt and thumbnail return $str; } I don’t recall if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)