PHP - Moved: Echo Image In Wordpress Post
This topic has been moved to PHP Applications.
http://www.phpfreaks.com/forums/index.php?topic=348171.0 Similar TutorialsThis topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=333014.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=352987.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=318539.0 OK, have no idea what's going on... I've done this a million times... why wont this output!?? I must have a major brain meltdown and dont know it yet!!! Code: [Select] <?php // this echoes just fine: echo $_POST['testfield']; // but this wont echo: echo if (isset($_POST['testfield'])) { $_POST['testfield'] = $test; } echo $test; /// or even this DOESNT echo either!: $_POST['testfield'] = $test; echo $test; ?> Hello, I have a website designed in simple php http://www.fsbizcollect.com/. It has a wordpress blog installed under sub-directory called "business-debt-collection-agency-blog" To query posts from blog on home page, I am using: <? foreach($sql->select("wp_posts", "where post_status = 'publish' order by post_date desc limit 3") as $row){ ?> <div class="bEntry"> <h2><?= $row['post_title'] ?></h2> <h3><?= date('F j, Y', strtotime($row['post_date'])) ?></h3> <p> <?= $row['post_excerpt'] ?> <a href="<?= $row['guid'] ?>">Read More</a></p> </div> <? } ?> It is working fine. I want to put post thumbnails on homepage. Post thumbnail should be automatically resized to width=110px and will be placed in : <div class="blogThumb"> POST THUMBNAIL PHP SCRIPT WILL COME HERE </div> Could anyone provide php script for this? Thank you Hi, im looking to pull 3 posts from a specific Wordpress Category. At the minute I can pull 3 latest posts and display them in a flash banner using the code below. Code: [Select] SELECT yah_posts.*, yah_postmeta.* FROM yah_posts LEFT JOIN yah_postmeta ON yah_posts.ID = yah_postmeta.post_id WHERE yah_postmeta.meta_key = 'largeimage' && yah_posts.post_status = 'publish' ORDER BY post_date DESC LIMIT 3 I want to be able to pull 3 latest posts from a specific category instead of just 3 latest posts from every category. I have put together this code below, but it doesn't seem to be working Code: [Select] $query = "SELECT yah_posts.*, yah_postmeta.* FROM yah_posts LEFT JOIN yah_postmeta ON yah_posts.ID = yah_postmeta.post_id AND LEFT JOIN $yah_term_taxonomy ON($yah_term_relationships.term_taxonomy_id = $yah_term_taxonomy.term_taxonomy_id) WHERE yah_postmeta.meta_key = 'largeimage' && yah_posts.post_status = 'publish' AND $yah_term_taxonomy.term_id = '1' AND $yah_term_taxonomy.taxonomy = 'category' ORDER BY post_date DESC LIMIT 3"; I had a wordpress site setup for my maintenance company. I am not trying to setup a blog on the site. I have the blogroll showing up on this page: http://handymore.com/blog/ but when you click the individual articles the single post page shows a Error 404 message. Could anyone point me in the right direction as to how to fix this so that the individual post pages are found? Any guidance would be appreciated. Hello all! So glad I found this forum. I would appreciate some assistance please. I'm working on a filter for a Custom Post Type . I need it to filter the list depending on the user's role. The way this should work is the following...
* Users in roles "formusers1" and "formusers2" can post. Users can only see their own posts. So far I can filter by roles "formusers1" and "formusers2" using `$query->set('author', $current_user->ID);` . However, when try to filter the list for role "formchecker1" I see posts from all roles. What am I doing wrong? Here's the rest of the code. Thanks for checking out!
```
function filter_posts_list($query) {
//MY VARIABLES
//FILTERING
if (current_user_can('formchecker2') && ('edit.php' == $pagenow) && $typenow == 'mycustomcpt' ) {
if ((current_user_can('formusers1') || current_user_can('formusers2')) && ('edit.php' == $pagenow) && $typenow == 'mycustomcpt') { Currently I can use php snoopy class to auto login in wordpress, but when I try to use the same method to post some articles in wordpress. It does not work. Any one has any ideas? I have tried to use httpwatch to monitor the post data and cookies. It seems I have include everything, but still doesn't work. thanks very much. This really driving me crazy. <?php include "Snoopy.class.php"; $snoopy = new Snoopy; //login part $submit_url = "http://localhost/wordpress/wp-login.php"; $submit_vars["log"] = "baibai"; //username $submit_vars["pwd"] = "123456"; //password $submit_vars["rememberme"] = "forever"; $submit_vars["redirect_to"] = "http://localhost/wordpress/wp-admin/"; $submit_vars["testcookie"] = "1"; $submit_vars["wp_sumbit"] = "submit"; $snoopy->submit($submit_url,$submit_vars); print $snoopy->results; $snoopy->setcookies(); $cookies = $snoopy->cookies; print_r ($cookies); //above part runs perfectly //post $snoopy->fetchform("http://localhost/wordpress/wp-admin/press-this.php"); print $snoopy->results; preg_match('/name=\"_wpnonce\" value=\"([0-9a-z]+)/',$snoopy->results,$matches); print $submit_vars1["_wpnonce"] = $matches[1]; $submit_vars1["autosave"] = ""; $submit_vars1["newtag[post_tag]"] = ""; $submit_vars1["tax_input[post_tag]"] = ""; $submit_vars1["autosave"] = ""; $submit_vars1["title"] = "title"; $submit_vars1["content"] = "content this is what i want post in wordpress"; $submit_vars1["original_post_status"] = "draft"; $submit_vars1["prev_status"] = "draft"; $submit_vars1["post_type"] = "text"; $submit_vars1["publish"] = "发布"; $submit_vars1["_wp_http_referer"] = "/wordpress/wp-admin/press-this.php?u=http%3A%2F%2Flocalhost%2Fwordpress%2Fwp-admin%2Ftools.php&t=%E5%B7%A5%E5%85%B7%20%E2%80%B9%20ekeyvision%20%E2%80%94%20WordPress&s=&v=4"; $submit_url1 = "http://localhost/wordpress/wp-admin/press-this.php?action=post"; $snoopy->submit($submit_url1,$submit_vars1); print $snoopy->results; ?> Also I do not want to use XML-RPC to solve this issue, since xml-rpc are not available is some settings. thanks Hello, Thanks for reading this. I'm working on a project where the homepage should be a Today's Deal and I'm using the Auto delete posts plugin to move the Today's Deal to the "Previous Deals" Category, after 24 hours. My task is to automatically redirect the homepage to the only post in Today's Deal Category, which will have different permalinks everyday. I'm querring the post with: <?php query_posts("cat=41&showposts=1"); ?> And I tried redirecting to the result with: <?php $url = the_permalink(); header("Location: $url"); ?> just after query_posts... but no success. I tried several other things too, apart from searching the web a lot before posting here. Help! Anyone? Thanks in advance! Hope someone here can help me. Ive been commissioned to convert a template to wordpress that includes a portfolio... I built a portfolio page from a custom post type. that works. Items are categorized with a custom taxonomy named port_cats. that works also On the portfolio page, there is tabbed content built with jquery to show and hide items by category. So theres a category nav menu, plus each item wrapped in classes to show and hide. Im stuck on plugging this in correctly, and am SO CLOSE. I have the category nav list working, but having trouble getting worpress to read the correct category slug inside the loop. Heres how the jquery needs to work: for the menu: Code: [Select] <li><a href="#" rel="category-slug">Category Name</a></li> to hide and show the items: Code: [Select] <ul> <li class="category-slug"> title/thumb/content </li> </ul> Heres my code: Code: [Select] <ul class="select"> <?php //list custom portfolio categories $taxonomy = 'port_cats'; // define portfolio categories from taxonomies in functions.php $tax_terms = get_terms($taxonomy); foreach ($tax_terms as $tax_term) { echo '<li><a href="#" rel="' . $tax_term->slug . '">' . $tax_term->name.'</a></li>'; } ?> </ul> <ul class="display"> <?php // ADD PORTFOLIO $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => 6)); while ( $loop->have_posts() ) : $loop->the_post(); $custom = get_post_custom($post->ID); $screenshot_url = $custom["screenshot_url"][0]; $website_url = $custom["website_url"][0]; ?> <li class="<?php echo $tax_term->slug; ?> "> <a href="<?=$website_url?>"><?php the_post_thumbnail(); ?></a> <?php the_title(); ?> <?php the_content(); ?> <a href="<?=$website_url?>Learn more</a> </li> <?php endwhile; ?> </ul> Whats happening is that worpdress is repeating the last category slug on every display item... can anyone tell me what i have wrong here??? THANK YOU! Trisha This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=310048.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=314030.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=314808.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=311671.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=358684.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=327275.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=334215.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=347669.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=353224.0 |