Overflow
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: index renamed, problems with MS installationTry putting this in your .htaccess
DirectoryIndex index.html index.php
Whatever is first will take priority. You can add as many layers as you want.
Forum: Fixing WordPress
In reply to: index renamed, problems with MS installationHmmm. It’s been a few years since I’ve had that same problem. In my history, the resolved thread was here.
At the end the guy changes his “index.html” to “default.html” and it worked for him. It might be that default gets priority over index. I just can’t remember. But there is a way in the htaccess to prioritize too, just can’t find it right now.
Sorry for the if’s and but’s and IDK’s but I know it’s possible without changing your index.php
Forum: Fixing WordPress
In reply to: using wp_tag_cloud with custom taxonomyMaybe you want to use get_the_term_list… just replace “my_custom_tax” with your custom taxonomy.
$cats_tax = get_the_term_list( $post->ID, 'my_custom_tax', '<li>', ',</li><li>', '</li>') ; ?> <ul> <?php echo $cats_tax ?> </ul>
Forum: Fixing WordPress
In reply to: Get taxonomy of a post for single.php<?php $current_query = $wp_query->query_vars; $wp_query = new WP_Query(); $wp_query->query(array( $current_query['taxonomy'] => $current_query['term'], 'posts_per_page' => 10, )); while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
Forum: Fixing WordPress
In reply to: index renamed, problems with MS installationWhich index are you talking about? The theme index or the WordPress index. If you change the WordPress index, your site will not load. One way to use the index.html is to give it priority in your htaccess file while keeping your index.php
Forum: Fixing WordPress
In reply to: Movong a html live site to a local copy of wordpress to rebuildHow is the original site created? If it is WordPress, then check out, https://codex.www.ads-software.com/Moving_WordPress
If it was another CMS, then you’ll have to search. There are some services out there for going from, Joomla or Drupal to get your content over.
If it was an old static site, you might have to start copying and pasting.
Forum: Fixing WordPress
In reply to: In what location does the global variable $wp_query get setup?I think this video is great. He goes into detail about how and queries are loaded and when. It had a couple ah-ha moments for me. It may not answer your specific question, or it might.
Forum: Fixing WordPress
In reply to: Using custom taxonomy with query_posts on taxonomy.php templateTry this:
Title:
<?php single_cat_title( $prefix = '', $display = true ); ?>
Query:
<?php $current_query = $wp_query->query_vars; $wp_query = new WP_Query(); $wp_query->query(array( $current_query['taxonomy'] => $current_query['term'], 'paged' => $paged, 'posts_per_page' => 10, )); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> //...Do Stuff... <?php endwhile; wp_reset_postdata(); ?>
Forum: Fixing WordPress
In reply to: Move database to a shared databasaeI think I understand what you’re trying to do.
You could do a find and replace with your db in an editor that replaces all “wp_” with “whatever_” for your prefix. Just make sure that your config.php reflects the new prefix.
Forum: Themes and Templates
In reply to: Author page paginationOk, please double check, but I think I got it all working.
First, i put this function into my functions file from this thread: (I’m working with 3 CPT)
https://www.ads-software.com/support/topic/modifying-author-archive-to-include-custom-post-type-and-pagination?replies=4function custom_post_author_archive( &$query ) { if ( $query->is_author ) $query->set( 'post_type', array( 'filmmaking', 'biology', 'blog' )); remove_action( 'pre_get_posts', 'custom_post_author_archive' ); // run once! } add_action( 'pre_get_posts', 'custom_post_author_archive' );
Then, my Author.php file looks like this where I add, “author” to the query arguments in a dynamic way.
<?php /** * Template for Author */ get_header(); ?> <div id="page-left"> <?php if ( have_posts() ) : ?> <?php the_post(); ?> <!-- you can put Author header here --> <?php rewind_posts(); //then rewind ?> <?php $author_details = $wp_query->get_queried_object(); $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array( 'post_type'=> array('blog', 'filmmaking', 'biology' ), 'paged' => $paged, 'posts_per_page' => 2, 'author' => $author )); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <h2><a href="<?php the_permalink(); ?>">author <?php the_title(); ?></a></h2> <?php endwhile; endif; wp_reset_postdata(); ?> <?php untamed_pagi(); ?> </div><!-- page left --> <?php get_footer(); ?>
Working for me. Hope this helps you.
Forum: Themes and Templates
In reply to: Author page paginationI agree. you need to get the CPT in there somehow. I was able to get the pagination to work for my 2 authors and my page template queries by dropping the “if has_posts” But one of the authors gets a 404 after the second page. my code below. Almost there… looking for the same solution ??
<?php $author_details = $wp_query->get_queried_object(); $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(array( 'post_type'=> array('blog', 'filmmaking', 'biology'), 'paged' => $paged, 'posts_per_page' => 2, )); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <h2><a href="<?php the_permalink(); ?>">author <?php the_title(); ?></a></h2> <?php endwhile; wp_reset_postdata(); ?>
Forum: Themes and Templates
In reply to: Custom Post Type Pagination not workngWell, that’s usually the way it goes. You spend a whole day looking for something and once you post the question, you figure it out.
Working code for a Custom Post Type paginated on a Custom Page Template: The biggest difference being that there is no, “if have posts” I don’t think I had seen it before but it works.
<?php /** * Template Name: pagination test */ get_header(); ?> <?php //get_sidebar(); ?> <div id="page-left"> <?php $wp_query = new WP_Query(); $wp_query->query(array( 'post_type'=>'filmmaking', 'paged' => $paged, 'posts_per_page' => 2, )); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php previous_posts_link('« Nyare') ?> <?php next_posts_link(' ?ldre »') ?> </div><!-- page left --> <?php get_footer(); ?>
Forum: Requests and Feedback
In reply to: Highlighted Post of the Correct answer by VotesFair enough.
Forum: Requests and Feedback
In reply to: Highlighted Post of the Correct answer by VotesWhy? How would that help? If that’s what floats your boat, there’s always
Exactly, I’ve found myself using those resources more these days than the WordPress forums. For me it quickly shifts your attention to the correct answer. For the WordPress forums, it’s like reading a story trying to find out which solution works. There are often many replies that are misunderstood or just plain wrong.
My opinion, guess it’s not yours. Curious as to why you think it’s a bad idea?
Forum: Networking WordPress
In reply to: Fatal error: Call to undefined function ms_subdomain_constants()First thing to try. Pull your ftp back up and navigate to that file. download WP and replace that file (if same version) I’ve had ftp skip a couple files before.