Keep getting same permalink with WP_Query?
Don’t forget to use esc_url() echo ‘<a href=”‘. esc_url( $link ).'”>Welcome</a>’; Also try this: get_permalink( get_the_ID() );
Don’t forget to use esc_url() echo ‘<a href=”‘. esc_url( $link ).'”>Welcome</a>’; Also try this: get_permalink( get_the_ID() );
A great starting point would be Mike’s answer to the question about cloning CrunchBase. You’ll want to do something similar with custom post types for entries in your directory. If you want to allow visitors to submit sites, you could perhaps use the TDO Mini Forms plugin to allow visitors to create a new listing, … Read more
Yup can be done with javascript. var $j = jQuery.noConflict(); $j(document).ready(function() { //external attribute $j(“a:not([@href*=http://YOURSITE.com/])”).not(“[href^=#]”) .addClass(“external”) .attr({ target: “_blank” }); });
You can try a plugin to do this: http://wordpress.org/extend/plugins/smart-404/ Reads the page URL and tries to find a page/post that it might match and redirect to it. Found out about this plugin from: http://www.aebeta.com/web-hosting/seo/7-seo-friendly-404-plugin-for-wordpress.html
Page Permalink from $id If you know the Page $id, use get_permalink(): <?php $permalink = get_permalink( $id ); ?> Page Permalink from $slug If you know the Page $slug, such as /about (including hierarchy, such as /about/work), use get_page_by_path() to determine the Page $id, then use get_permalink(). <?php $page_object = get_page_by_path( $slug ); $page_id = … Read more
I didn’t understood your question well, but try this. Explanation is in the comments. // your taxonomy name $tax = ‘post_tag’; // get the terms of taxonomy $terms = get_terms( $tax, [ ‘hide_empty’ => false, // do not hide empty terms ]); // loop through all terms foreach( $terms as $term ) { // if … Read more
These options are hardcoded into the tmpl-attachment-display-settings Underscore media template in the /wp-includes/media-template file: <script type=”text/html” id=”tmpl-attachment-display-settings”> <h3><?php _e(‘Attachment Display Settings’); ?></h3> …cut… <select class=”link-to” data-setting=”link” <# if ( data.userSettings && ! data.model.canEmbed ) { #> data-user-setting=”urlbutton” <# } #>> <# if ( data.model.canEmbed ) { #> <option value=”embed” selected> <?php esc_attr_e(‘Embed Media Player’); ?> … Read more
The login_headerurl filter is for changing the logo url of login page, according to the Codex. To change the logo URL of your homepage, you will have to look into your theme’s header.php file. You logo and it’s link are included there. Depending on your theme, they way that your URL is generated may be … Read more
You’re probably getting that error because WordPress doesn’t have the $wp_rewrite global loaded yet for some reason. Either something deactivated it, or you’re trying to run those functions before WordPress has a chance to load it. If you’re trying to do this in a plugin or in your theme’s functions.php file, make sure you’re inside … Read more
You are on right track, with few minor kinks. You need to modify $atts and return it. Any arguments after the first one are provided for information and should not be changed. You need to tell add_filter() that you expect more than one argument. The example with some debug code would be along the lines … Read more