wordpress-theming

How to display latest posts Wordpress

拥有回忆 提交于 2019-12-14 03:27:52
问题 On one of my pages I want a section to show the latest 3 news posts. Is there a simple way of doing this? 回答1: <?php function latest_post() { $args = array( 'posts_per_page' => 3, /* how many post you need to display */ 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'post_type' => 'post', /* your post type name */ 'post_status' => 'publish' ); $query = new WP_Query($args); if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?> <a href="<?php the

Wordpress Custom font not found

坚强是说给别人听的谎言 提交于 2019-12-14 03:27:09
问题 I created a custom wordpress theme from scratch I am trying to use custom font what I done upload font to wp-content/themes/mythemefolder/fonts/fontfolder in theme default style.css @font-face { font-family: "fontname"; src: url('fonts/fontfolder/fontname.otf'); } *{font-family: "fontname";} when I visti page text are not in desired font I check console show error : Failed to load resource: the server responded with a status of 404 (Not Found) http://domainname.com/wp-content/themes

Enqueue jquery-ui elements in Wordpress theme option page

谁说胖子不能爱 提交于 2019-12-14 02:57:56
问题 Well, I know this is a commonly asked question, but almost all of them like '2 or 3 years ago'. Since Wordpress had some serious core changes recently, thought it'd be better to get an updated answer. What I wanted to do is add this jquery slider to my wordpress custom admin page. In today's Wordpress, is jquery-ui coming in built ? or I do need to include it using wp_enqueue_script or I should use some external url CDN? Since I'm working on Wordpress 4.2, could you please tell me the proper

Activating reveal.js in WordPress 4.2.2

…衆ロ難τιáo~ 提交于 2019-12-13 20:05:50
问题 I want to use reveal.js in the WordPress theme of my website, which uses WordPress 4.2.2. I followed the instructions by alleyinteractive here. I downloaded reveal.js for WordPress. I extracted it into public_html/wp-content/themes/revealjs-wp-theme-master . I downloaded Fieldmanager plugin and extracted the zip file into public_html/wp-content/plugins/wordpress-fieldmanager-1.0.0-beta.2 . I can see the theme in wp-admin as shown below: However, I am afraid to activate the theme as I may lose

Isotope add dynamically getSortData

好久不见. 提交于 2019-12-13 16:35:10
问题 I'm trying to use isotope.js on my wordpress theme. I would sort the object in this way, where "Series,Music,Cultura,Sport" are "filter" generated by the custom taxonomy. var $container = $j('.containerport'); $container.isotope({ stamp: '.stamp', itemSelector: '.thumbportfolio', getSortData : { Series : function( $elem ) { var isSeries = $j($elem).hasClass('Series'); return (!isSeries?' ':''); }, Musica : function( $elem ) { var isMusica = $j($elem).hasClass('Musica'); return (!isMusica?' ':

How to change contact form 7 Redirecting URL dynamically - WordPress

≡放荡痞女 提交于 2019-12-13 15:16:50
问题 I am building a website for one of my clients and they want a function into their website some thing like the following: when people click the download link, a form will appear ( contact form 7) and after visitors put their details , it will re-directed to the download link. I able to re-direct to a new page after form submission by using following additional setting to the contact form 7. on_sent_ok: "location = 'http://example.com/';" However, They have 10 files , I need to change the re

Phpstorm doesn't know how to run Wordpress

不问归期 提交于 2019-12-13 10:13:20
问题 I've tried all I could found here and googling. Include paths, external libraries, interpreter settings... Whenever I try to run my theme's index.php file: C:\XAMPP\php\php.exe "C:\path\to\project\wp-content\themes\MYTHEME\index.php" Fatal error: Call to undefined function get_header() in C:\path\to\project\wp-content\themes\MYTHEME\index.php on line 1 Process finished with exit code 255 So yes on line 1 I'm just calling my header. Turns out it's trying to run index.php like a standalone file

Where Can I Download The Wordpress Penscratch Theme Files?

拜拜、爱过 提交于 2019-12-13 09:15:26
问题 My website is www.rosstheexplorer.com. I am fairly sure I have managed to corrupt / break my Penscratch Wordpress Theme. When I try and load my website I am greeted with a white page. Where can I redownload the Wordpress Penscratch theme files? I have access to my file manager. I was hoping to be able to download the Penscratch php files and then upload them to my file manager. 回答1: A simeple google search for you theme suggests this url https://en-gb.wordpress.org/themes/penscratch/ You can

WordPress conditional statement for front-page or inner page

邮差的信 提交于 2019-12-13 07:37:20
问题 I need help with the templating in wordpress. On the front-page I want a custom static header, while all the other pages should use the title for their page instead. Also, if the page is not the front-page I want to add some custom HTML next to the title. What is the best way to do this? 回答1: You can do it like this, including the following in header.php (I've just added some example content); <?php if ( is_front_page() ) { echo '<div id="homestuff">Home stuff in here</div>'; } elseif (is

How to customize Date Format in Wordpress

本小妞迷上赌 提交于 2019-12-13 07:03:21
问题 I need to customize the date format in Wordpress. I know that minor date changes can be made from Dashboard << Settings << General << Date. But my needs are not fulfilled from that. I need that on post page, Month should have different font style and Day with a different font. 回答1: If I'm understanding your question correctly, one solution would be to wrap each part of the date in a different span class. So whenever you want to insert the date you would use something like the following: <?php