How to create cutom link for page
Change Settings -> Permalinks to Post Name. Go to your page and edit the Permalink field below the title field.
Change Settings -> Permalinks to Post Name. Go to your page and edit the Permalink field below the title field.
In WordPress, the footer scripts are enqueued using wp_enqueue_scripts into wp_footer(). So it is hard for you to find the direct scripts link in footer.php. To change the path you can go to PHPmyAdmin and edit the siteurl and home fields in options table of your database. You can include jQuery from CDN using the … Read more
And the strange part: both codes echo the same string for $url!!! No, they don’t. Look at the page source. esc_url() is encoding the & control character. You can’t do that and expect the HTTP request to work correctly. Use esc_url_raw() instead. Note the description in the Codex concerning that function: The esc_url_raw() function is … Read more
For all my answers I’m assuming you both have the legal rights to use those images and are aware of any implications of duplicate content (SEO etc). That being said there are definitely ways. At what point would you like to scrape images? Regularly? If so look into WP_Cron and automate it. If you just … Read more
The simplest and quickest solution would be to use the add_rewrite_endpoint function. <?php add_rewrite_endpoint( $name, $places ); ?> So in your case it would be something like this: add_rewrite_endpoint( ‘user’, EP_PERMALINK | EP_PAGES ); An user URL would look like this: http://www.example.com/my-page/user/john To access the variable: $user = get_query_var( ‘user’, false );
You can set the rewrite slug when you register your post type: $args = array( ‘rewrite’ => array( ‘slug’ => ‘media/lajmet’ ) // other args… );
The WP function get_attached_media() should provide the info you need. If used in this way… $media = get_attached_media( ‘image’ ); … the $media var should contain the wp_post objects for all attached images. Function documentation in the WP Codex: https://developer.wordpress.org/reference/functions/get_attached_media/
try get_pages with ‘child_of’ => get_the_ID(), ‘parent’ => get_the_ID(), If you need i can post full code EDIT : if ( is_singular(‘post’) ) { $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ => null, ‘parent’ => $post->ID , ‘child_of’ => $post->ID, ‘sort_order’ => ‘desc’ ); $attachments = get_pages( $args ); if ( $attachments … Read more
You’r missing $post variable ( it is not defined and that for you don’t get post_name ). As a solution you could add global $post; You’r code would be like: <a href=”https://wordpress.stackexchange.com/questions/201956/<?php echo site_url(“/article/full-text/’); global $post; $slug = $post->post_name; echo $slug; ?>” title=”<?php the_title_attribute(); ?>”>Full Text</a>
Use add_query_arg to make sure the url is created the right way. How is the wishlist link outputted? Trough wp_nav_menu? I would add it to the link on creation, so you don”t have to use wp_redirect.