Jump to content

Aleksey

Member
  • Posts

    15
  • Joined

  • Last visited

Aleksey's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Ok thanks. Do you think that i should know to solve this problem after beginners course or this is some advanced level of programming that needs time to be understand?
  2. Even and odd selectors are not possible in this case because image and text in wordpress post are treated as one tag.
  3. I have deleted media photos into posts and added featured photos instead. I did that because featured images arent in same paragraph with text. Featured photos have id because in index.php of my theme i wrote: <div id="blogphoto"><?php the_post_thumbnail(); ?></div> Now i am pulling out latest 3 posts (only text), but i dont know how to pull out latest featured images. Can you help me to add some code to my code above to display featured images of latest posts too?
  4. i actually made a progress and added this code: <div id="wp-posts"> <?php $args = array('numberposts'=>1); $recent_posts=wp_get_recent_posts($args); foreach( $recent_posts as $recent_post ){ echo "<span>".$recent_post['post_date']."</span> <br>"; echo "<p>".$recent_post['post_content']."</p><br><br>"; } ?> </div> <div id="wp-post2"> <?php $args = array('numberposts'=>1 , 'offset'=>1 ); $recent_posts=wp_get_recent_posts($args); foreach( $recent_posts as $recent_post ){ echo "<span>".$recent_post['post_date']."</span> <br>"; echo "<p>".$recent_post['post_content']."</p><br><br>"; } ?> </div> <div id="wp-post3"> <?php $args = array('numberposts'=>1 , 'offset'=>2 ); $recent_posts=wp_get_recent_posts($args); foreach( $recent_posts as $recent_post ){ echo "<span>".$recent_post['post_date']."</span> <br>"; echo "<p>".$recent_post['post_content']."</p><br><br>"; } ?> </div> Now i am pulling out 3 latest posts of my blog and i placed each post into separate div. It gives me beter control and i can style each post differently. However, it seems that wordpress puts image and text into same paragraph and when i want to style only text of the post, for example: #wp-post3 { background-color: green; } it changes the background of the entire post that contains image and text, not only the text, wrapping the image. Is there any way to separate images and paragraphs in wordpress posts so i can style them differently?
  5. I wrapped the php code with div id="wp-content" , i tried to add some style, width, background color and it works. However i have very limited control with styling these posts. I can style wp-content div or #wp content img or p{ (div which is pointing to the paragraphs or images). I would like to style my posts separately, for example to add different width for first image and paragraph, and the other for the last two and different layout too. When i go on "inspect element" tool i see this as seen on photo - all images have allignnone class, h3 and p tags dont have anything. How to differently style paragraphs, images and headings to the 3 latest post?
  6. I made a static html, css and javascript website. In subfolder of the site i installed wordpress and made a theme from a static html page which contains blog with news posts. Then i connected it with the rest of the website. I would like to embend 3 latest wordpress posts on my static home page and add style to them. I added this code to my static home index.php page <?php define('WP_USE_THEMES', false); require('vesti/wp-blog-header.php'); ?> <?php $number_of_posts = 3; $args = array( 'numberposts' => $number_of_posts ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent_post ){ echo "<span>".$recent_post['post_date']."</span> <br>"; echo "<h3>".$recent_post['post_title']."</h3>"; echo "<p>".$recent_post['post_content']."</p><br><br>"; } ?> Now i see my 3 latest posts with images and text but i dont know how to style them with CSS. I would like to add style to these posts - to paragraphs and images so i could set desired layout and appearance. And optionally , to shorten the text with "read more" option. Can anyone help me solve this problem? ?
  7. I have a problem with WordPress. When i add new theme and install it, my whole page looks blank, no background photo or any colours, just text and white background. I dont have any plugins except Akismet Anti-Spam. Can anyone help me solve this problem?
  8. Thanks Stef, i solve the problem with MyAdmin! I didnt know that its possible to connect user with database just using MyAdmin, in MySQL video tutorial you did it with cPanel and talked about third party apps and command line.
  9. A question about MySQL beginners course, part of connecting mysql with php, the video was very quickly and i didnt understand well. 1) Is there any simple way to connect a user to a database without such apps such cPanel? (from MyAdmin) 2)You told - "I am just using cPanel to connect a user with a database". Is there some free cPanel alternative that would work good on both mac and windows operating systems? For example i found some alternatives but on the download page i didnt see macos supported.
  10. I am currently working on a website project and want to edit some parts of my website (news section and product page photos) with cms. I finished beginners javascript and php courses.My questions are: 1) Is it necessary to finish Begginers "Build a CMS project" first before start using some open source cms ? 2) Should cms be added from the very beginning of web design (because i already made main page and another one with html and css)? 3) Does anyone knows about some good tutorial out there? Because when i was searching for Wordpress tutorial, everybody just talks about making new theme. I dont need that just simple editing capabilities with cms. I am hoping to get some answers because i stopped working on my website project because its cms needs.
  11. I just started Beginners PHP course, when i use echo to display the result, it shows nothing. When i open beginners course file with forms it doesnt display echo on the screen as well. Can someone help me solve this problem?
  12. I understand that but if we start with 5 then print on the screen current number, and then substract 1 from it, and repeat cycle, why isnt order 5,4,3,2,1 there? instead it goes from 1.
  13. I have two question about JS loops. Its about while loops. 1)if we type this line of code target.innerHTML = "LoopCount: " + loopCount + "<br>" + target.innerHTML; why does it write from lowest number to highest like this? LoopCount: 1 LoopCount: 2 LoopCount: 3 LoopCount: 4 LoopCount: 5 The function tells that starting loop is 5,we are targeting empty paragraph with id "target", then writting into it some text and saying that we want to see current loop number, which is 5 at the beginning , then we are substracting 1 from it(decrementing), and repeating, writing and so on again, so why doesnt it goes backward, 5,4,3,2,1? Why the first number is 1 when the starting was 5? My logic tells me if you start with 5, then print current number and then decrement it, and repeat it again all over , it should go in 5,4,3,2,1 order. function doItAgain(message) { var loopCount = 5; while(loopCount > 0) { var target = document.getElementById("target"); target.innerHTML = "LoopCount: " + loopCount + "<br>" + target.innerHTML; console.log("LoopCount is now: " + loopCount); loopCount = loopCount -1; } console.log("End loop"); var button = document.getElementById("looper"); button.value ="Done looping!"; 2) if we look at opposite case and write target.innerHTML = "target.innerHTML + "LoopCount: " + loopCount + "<br>" ; then it writes LoopCount: 5 LoopCount: 4 LoopCount: 3 LoopCount: 2 LoopCount: 1 But if we look the order into syntax, shouldnt it write this? 5 LoopCount: 4 LoopCount: and so on....
×
×
  • Create New...