next_posts_link and previous_posts_link problem

When using custom post types I got around this problem by using the following code. Of course you will need to put in the HTML for how you want it to display on your site. <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query->query(”); // Enter you query here ?> <?php while ($wp_query->have_posts()) … Read more

problem with wordpress author profile page URL

How are you creating the author’s link? If you put in your template: <?php the_author_posts_link(); ?> It will write the author’s name and link for the current post. To modify the template for the author page, wordpress search for the following files in your theme’s folder (in this order): author-{nicename}.php author-{id}.php author.php archive.php index.php

Use different template than author.php for get_author_posts_url()

There is a filter called author_link. You can use that change the URL to whatever you want. add_filter( ‘author_link’, function ($link, $author_id, $author_nicename) { var_dump($link, $author_id, $author_nicename); // debug return $link; // return your modified URL }, 1,3 ); The question does not have enough detail to allow for more specific code. You can use … Read more

Save buddypress xprofile data to author meta

Use this action hook found in buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php do_action_ref_array( ‘xprofile_data_after_save’, array( $this ) ); You’ll need to use the actual field_id for your xprofile description. This example assumes it is 25. You can get the field_idby going to wp-admin > Users > Profile Fields and clicking ‘Edit’ on that field. The field_id will appear in the … Read more

Most recent post is missing from Author page

The mistake is in your first block of code: <?php if (have_posts()): the_post(); ?> <h3> <?php _e(‘All posts by’); ?> <?php echo get_the_author(); ?> <span class=”arrows”>&raquo;</span> </h3> <?php while (have_posts()) : the_post();?> You call the_post() to populate the regular template tags (i.e. get_the_author()) but don’t use the rest of the post. Then, inside your while … Read more

How to pull user/author profile data in a plugin?

If you’re trying to get user data for the displayed profile, you can do it like so: $thisauthor = get_userdata(intval($author)); That’ll return an object filled with everything you need. For instance, if you need the user ID, you can call it like so: $thisauthor->ID I use this extensively on the profiles on my site: http://androidandme.com/user/clark … Read more

Is author.php a core file?

If you are talking about author.php in your theme directory, usually at wp-content/themes/<YOURTHEMENAME> this isn’t a core file but part of your theme. Themes don’t get changed when WordPress is updated, so concerning WordPress updates themes are safe. But if your theme isn’t custom made by you (which I assume here) this file would be … Read more

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